Merging address labels

  • I have created several VBA Word programs to create mailing labels. I am stuck at the moment. The programs work fine for the most part, however, Word keeps defaulting the labels to the last ones used (usually file folder labels).


    Does anyone know if any code that will select the correct address label in VBA?


    Any help is greatly appreciated!


    Shane

  • HI, Shane. Did you try recording it?


    I recorded this macro, which appears to grab the right labels:


    Code
    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 8/9/2004 by Anne Troy
    '
        Application.MailingLabel.DefaultPrintBarCode = False
        Application.MailingLabel.CreateNewDocument Name:="5160", Address:="", _
            AutoText:="ToolsCreateLabels1", LaserTray:=wdPrinterManualFeed
    End Sub



    Now...another thing you can do...why keep creating a new labels file? Why not create one, save it as a template, and call the template instead?


    HTH!

  • Thanks! For some reason, when I created it using the macro record, it did not record the Name:="5160"


    Thanks for the help! Will keep the template suggestion in mind!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!