S
sstires
I am very new to Word Macros and recorded a macro to perform a mail merge.
When I try to run the macro I receive the message "Runtime Error 4198" and
"Execute Pause:=False" is highlighted when I edit the macro in VB Editor.
The macro definition is:
Documents.Add DocumentType:=wdNewBlankDocument
ActiveDocument.MailMerge.MainDocumentType = wdCatalog
ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\CM3\ASB\REPORTS\ASBMESO.DAT", ConfirmConversions:=False,
ReadOnly:= _
False, LinkToSource:=True, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", WritePasswordDocument:="",
WritePasswordTemplate:= _
"", Revert:=False, Format:=wdOpenFormatAuto, Connection:="",
SQLStatement _
:="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
Thanks in advance for any help you can provide.
When I try to run the macro I receive the message "Runtime Error 4198" and
"Execute Pause:=False" is highlighted when I edit the macro in VB Editor.
The macro definition is:
Documents.Add DocumentType:=wdNewBlankDocument
ActiveDocument.MailMerge.MainDocumentType = wdCatalog
ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\CM3\ASB\REPORTS\ASBMESO.DAT", ConfirmConversions:=False,
ReadOnly:= _
False, LinkToSource:=True, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", WritePasswordDocument:="",
WritePasswordTemplate:= _
"", Revert:=False, Format:=wdOpenFormatAuto, Connection:="",
SQLStatement _
:="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
Thanks in advance for any help you can provide.