P
Phil
I have a mail merge document called "Gift Aid letter.docx" (tried it as both
a docx and dotx) with graphics and wording in the header. The mail merge data
is in a csv file. The datafile is called "Gift Aid letter.888"
Mailmerge is being run through Access & VBA.
Here is the relevant code
Set WordDoc = wordApp.Documents.Open(strDocName)
strActiveDoc = wordApp.ActiveDocument.Name
'wordApp.Activate
If bolPrint = False Then
wordApp.Visible = True
wordApp.Activate
wordApp.WindowState = 0 'wdWindowStateRestore
End If
STOP 1
WordDoc.MailMerge.OpenDataSource _
Name:=strDataDir, _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", ent:="", PasswordTemplate:="",
WritePasswordDocument:="", _ WritePasswordTemplate:="", Revert:=False,
Format:=wdOpenFormatDocument, _ Connection:="", SQLStatement:="",
SQLStatement1:=""
STOP 2
With WordDoc.MailMerge
.Destination = 0 ' 0 = new doc
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .datasource
.FirstRecord = 1
' .LastRecord = 1
End With
.Execute Pause:=False
STOP 3
End With
at STOP 1 I see the original letter with the name & address of the peson
printed on the previous run. Letter name is Gift Aid letter.docx at STOP 2I
see the original letter with the Merge field names showing. Letter name is
Gift Aid letter.docx at STOP 3 I see the merged letter with the new name &
address, but only the wording in the header. The graphics have disappeared.
This letter is called Form Letters1. The STOP2 letter is still visible.
Eventually Form Letters1 gets saved as "Test Mail Merge.docx"
When I open this, even the wording in the header has vanished. Only the
actual body wording is correct What am I doing wrong?
Thanks
Phil
a docx and dotx) with graphics and wording in the header. The mail merge data
is in a csv file. The datafile is called "Gift Aid letter.888"
Mailmerge is being run through Access & VBA.
Here is the relevant code
Set WordDoc = wordApp.Documents.Open(strDocName)
strActiveDoc = wordApp.ActiveDocument.Name
'wordApp.Activate
If bolPrint = False Then
wordApp.Visible = True
wordApp.Activate
wordApp.WindowState = 0 'wdWindowStateRestore
End If
STOP 1
WordDoc.MailMerge.OpenDataSource _
Name:=strDataDir, _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", ent:="", PasswordTemplate:="",
WritePasswordDocument:="", _ WritePasswordTemplate:="", Revert:=False,
Format:=wdOpenFormatDocument, _ Connection:="", SQLStatement:="",
SQLStatement1:=""
STOP 2
With WordDoc.MailMerge
.Destination = 0 ' 0 = new doc
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .datasource
.FirstRecord = 1
' .LastRecord = 1
End With
.Execute Pause:=False
STOP 3
End With
at STOP 1 I see the original letter with the name & address of the peson
printed on the previous run. Letter name is Gift Aid letter.docx at STOP 2I
see the original letter with the Merge field names showing. Letter name is
Gift Aid letter.docx at STOP 3 I see the merged letter with the new name &
address, but only the wording in the header. The graphics have disappeared.
This letter is called Form Letters1. The STOP2 letter is still visible.
Eventually Form Letters1 gets saved as "Test Mail Merge.docx"
When I open this, even the wording in the header has vanished. Only the
actual body wording is correct What am I doing wrong?
Thanks
Phil