none
Save individual letters from mail merge RRS feed

  • Question

  • I am not new to Word but not an expert either. I have read discussions about adding a macro or an add-in so that I may save individual letters from a mail merge. I haven't added a macro before so would like to know the how-to steps for that and I would also like to know what the add-in is so I can ask my company to purchase it. This is the macro that the discussion had:

    Sub SplitMergeLetter() 
    ' splitter Macro modified to save individual letters with 
    ' information from data source. The filename data must be added to 
    ' the top of the merge letter - see web article.

    Selection.EndKey Unit:=wdStory 
    Letters = Selection.Information(wdActiveEndSectionNumber) 
    Selection.HomeKey Unit:=wdStory 
    Counter = 1 
    While Counter < Letters 
        Application.ScreenUpdating = False 
        With Selection 
           .HomeKey Unit:=wdStory 
           .EndKey Unit:=wdLine, Extend:=wdExtend 
           .MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend 
        End With 
        fldrname = Selection 
        Docname = "C:\Clean DataBase\WdQuotes\" & fldrname & "\" & "Guarantee.Doc" 
        ActiveDocument.Sections.First.Range.Cut 
        Documents.Add 
        With Selection 
            .Paste 
            .HomeKey Unit:=wdStory 
            .MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend 
            .Delete 
        End With 
        With ActiveDocument 
            .Sections(2).PageSetup.SectionStart = wdSectionContinuous 
            .SaveAs FileName:=Docname, _ 
            FileFormat:=wdFormatDocument 
        End With 
        ActiveWindow.Close 
        Counter = Counter + 1 
        Application.ScreenUpdating = True 
    Wend

    End Sub


    Monday, July 30, 2018 3:41 PM

All replies

  • For using a macro you get on the Internet see

    https://wordmvp.com/FAQs/MacrosVBA/CreateAMacro.htm

    That explains how to use the VBA Editor and insert the code.

    About the add-in I'm afraid we can't help you unless you provide a link to the discussion. There are many add-ins around...


    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    Monday, July 30, 2018 4:00 PM
    Moderator