Posts by jtemp57

    Re: Macro to open Word and Start Mail Merge

    I am trying to do the same thing but i keep getting a debug box. I have my mail merge already set up ready to go with the merge fields. Can someone look at the info below and help me out?

    Sub Print_Tags()
    Application.ScreenUpdating = True
    Application.DisplayAlerts = False
    Set appWd = CreateObject("Word.Application")
    appWd.Visible = True

    appWd.Documents.Open Filename:="C:\Users\J.Templet\Desktop\LOTO Print Tags\PRINTING TAGS1.docx"
    appWd.MailMerge.OpenDataSource Name:="C:\Users\J.Templet\Desktop\LOTO Print Tags\Isolation LOTO Template.xlsx" _
    , ConfirmConversions:=False, _
    ReadOnly:=False, LinkToSource:=False, AddToRecentFiles:=False, _
    PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
    WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
    Connection:="", SQLStatement:="", SQLStatement1:=""

    With ActiveDocument.MailMerge
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
    .FirstRecord = wdDefaultFirstRecord
    .LastRecord = wdDefaultLastRecord
    End With
    .Execute Pause:=False
    End With
    End Sub