Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Aug 2005
    Location
    Madison, Wisconsin, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro for Saving Word Doc (Word 2002)

    I am wondering if this is even possible....
    I have a large word doc that is a mail merge for a letter. So there are 700 pages in the document but each page is one letter. I would like to save each letter as a pdf named as the first address line. I would love this in a macro/script. Can this be done?

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    Welcome to the Lounge. Take a look at Cindy Meister's Cindy Meister's Mail Merge FAQ Page & see if that helps.

  3. #3
    New Lounger
    Join Date
    Aug 2005
    Location
    Madison, Wisconsin, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    The mail merge is already created from a program which is combining my database with this letter. It is executed from the program and I can't get in to see the code.
    Any other ideas?

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    Well, I'm not a VBA expert, but I would think that even after you have one long document with different sections, you could use the Master Document feature to break each section into a subdocument, & then save each subdocument as a separate file. However, the problem is getting the first line in each address to be Level 1 paragraph style. I couldn't do that directly using wildcards with Find/Replace, so it depends on the pattern of the addresses & the letter itself. There might be a way by changing the style definitions of the Heading 1 style in your letter to match the addresses, except that it's Level 1 paragraph style. Then you would need to change the first line in each address to Heading 1. That might be possible using Find/Replace.

    Hope this gives you some ideas.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    If you have one 700 page Word document and need 700 PDF files created then this is a simple task assuming you also have Acrobat installed. You wouldn't need to separate the Word file into pieces. The macro just needs to print each page separately to the PDF driver and supply a filename.

    To write this code you/we would need a sample of your file (a couple of records would be sufficient) so we would know how to find the correct filename information on the page. You/we would also need to know what version of Acrobat you are using since the printer driver name changed in one of the upgrades.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    New Lounger
    Join Date
    Aug 2005
    Location
    Madison, Wisconsin, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    Thank you so much for looking at this. I have attached my mail merge template. If you need a document that includes the mail merge let me know. I will have to work to remove all of our client's information.
    Every month I use this template and only the body of the letter changes.

    Thanks again!
    Attached Files Attached Files

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Macro for Saving Word Doc (Word 2002)

    The attached file includes a macro to do the task from the merge file you attached. This is very slow in its current form as the code waits 5 seconds per record to delete temp files created in the process - but it is better than doing it by hand. It was based on a job I did last year where the time hit wasn't multiplied by a number of records.

    Note that the code manipulates Acrobat directly rather than relying on the Print function.
    Attached Files Attached Files
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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