convert mail merge documents to individual pdf docs

Anonymous
2013-07-29T14:37:50+00:00

I created a mail merge using Word 2010.  It is several documents combined into one large Word file with section breaks.  It is many pages long.

I need to convert it into individual pdf documents.  I have used the vba code bleow with pdf creator with some success.  I now need to do the same thing with E-Copy 5.3

Sub SplitMergeLetterToPrinter()

    Dim Letters As Long, Counter As Long

    Letters = ActiveDocument.Sections.Count

    'MsgBox "Sections counted = " & Letters

    Counter = 1

    While Counter < Letters

        ActiveDocument.PrintOut Background:=False, Range:=wdPrintFromTo, _

            From:="s" & Format(Counter), To:="s" & Format(Counter)

        Counter = Counter + 1

    Wend

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

43 answers

Sort by: Newest
  1. Anonymous
    2013-12-30T08:34:42+00:00

    That was a super quick reply from Graham.

    Now we can output HTM files (not filtered). thanks for the modifications.

    But please see the files below and guide me how to fix.

    https://skydrive.live.com/embed?cid=6B32D1EE74870BB9&resid=6B32D1EE74870BB9%21616&authkey=AHcKRDc1gJEaeUo

    https://skydrive.live.com/embed?cid=6B32D1EE74870BB9&resid=6B32D1EE74870BB9%21615&authkey=ANYa5p3SBUPHZWU

    You will notice the format/alighment changes when exporting to HTM using the Addin instead of using the basic saveas feature.

    Perhaps just a little fix required.

    You let me know.

    Thank You indeed.

    muzafar

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-12-30T05:33:05+00:00

    It's a simple change to the add-in code

    Use this version instead - https://dl.dropboxusercontent.com/u/57986755/MMtoDocs%20Ver%203.0B.dotm

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-12-30T04:11:10+00:00

    Hi Graham,

    Your AddIn is a master piece mate... Great Job to you too... The link was on this page itself...

    When i save my myfile.docx as htm format, the htm file works file in web browsers and as Outlook signature.

    Well, your HTM export seems to create filtered HTM format which removes certain formatting.

    • Is it possible to export to normal HTM format instead of Filtered?

    Im a novice in Macros but i managed to compile these:

    1:


    Sub ExportToHTM()

    '

    ' ExportToHTM Macro

    '

    '

    ChangeFileOpenDirectory "H:\00-Public\99-UPDATES\SIGNATURES\DEC2013\DOCX"

    ActiveDocument.SaveAs2 FileName:= _

    "H:\00-Public\99-UPDATES\SIGNATURES\DEC2013\DOCX\ActiveDocument.Filename", FileFormat:= _

    wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, _

    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _

    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _

    False, CompatibilityMode:=0

    End Sub

    ---++++++++

    2:


    Sub ExportToHTM()

    '

    ' ExportToHTM Macro

    '

    '

    ChangeFileOpenDirectory "H:\00-Public\99-UPDATES\SIGNATURES\DEC2013\DOCX"

    ActiveDocument.SaveAs2  FileName:= _

    "ActiveDocument.Filename", FileFormat:= _

    wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, _

    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _

    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _

    False, CompatibilityMode:=0

    End Sub

    -----++++++++

    Both scripts do export my docx file to the correct htm format except that the file name is not what's required.

    As i have several docx files, i want the macro to output htm files using the current filename.

    e.g. myfile1.docx to myfile1.htm ;;; myfile2.docx to myfile2.htm

    I am sure you will find a solution for me Graham.

    Cheers to all,

    Muzafar

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2013-12-28T09:46:48+00:00

    Word document format and html format are very different from one another. Have you actually tried saving one of the merged documents as html? If the result works for you then http://www.gmayor.com/individual_merge_letters.htm will split a merge to html format.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-12-28T07:32:51+00:00

    Dear Doug,

    Fantastic Job! Your addin is working fine man.

    I am actually generating Signatures for 70 staff using Word 2013 Mail Merge Feature.

    Your addin enables us to output to different docx files.

    What i require now is outputing to htm file. Can you please help. I will try to setup macro though. (never used macro before)

    Thanks for your Support.

    Cheers and Happy New Year.

    Muzafar

    Was this answer helpful?

    0 comments No comments