+ Reply to Thread
Results 1 to 6 of 6

Using Merge Field in file name?

  1. #1
    Registered User
    Join Date
    01-21-2011
    Location
    Maidenhead/Sheffield
    MS-Off Ver
    Excel 2003
    Posts
    57

    Using Merge Field in file name?

    Hi All,

    I'm trying to put together a simple bit of code that cycles through my mail merge, and prints to PDF using a merge field value as a file name. The code i've got at the minute is as follows:

    Please Login or Register  to view this content.
    I'm normally fairly competant in excel with this sort of thing but word is a new ball game for me so any help would be much appreciated

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Using Merge Field in file name?

    Hi,

    Not sure how much help I'll be as like you Word isn't my thing but I'll try.

    What software are you using to create the pdf?

    Dom

    PS I may get told off for promoting a competitor but I know MacroPod (Word MVP) hangs around at Mr Excel sometimes and has helped me in the past.
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    01-21-2011
    Location
    Maidenhead/Sheffield
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Using Merge Field in file name?

    Hi Dom,

    I'm using an adobe driver I think? It's set up as a printer, and you click print to pdf!

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Using Merge Field in file name?

    You need to have Adobe Acrobat Professional if you want to control it with vba as far as specifying file names etc

    There's a link to some code I wrote here along with one that uses some alternative free pdf software:

    http://www.excelforum.com/excel-prog...be-writer.html

    It's all Excel oriented but theory should be the same if working with Word.

    Of course if you have access to Office 2007/2010 then pdf printing is built in.

    Dom

  5. #5
    Registered User
    Join Date
    01-21-2011
    Location
    Maidenhead/Sheffield
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Using Merge Field in file name?

    Thanks for that dom.

    The pdf driver definitely works as i've used it with excel vba. The syntax for word doesn't appear to be the same though

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Using Merge Field in file name?

    The driver itself is basically a printer driver so you can control it via vba as far as printing like your code showed but to do anything else you would need the pro version which allows you to set references to the distiller and control the file name etc. You might want to check out Planet PDF as well.

    Dom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1