Word 2007 mail merge error 5535 (bug? in Office Student Edition on

M

muchthewyza

Automating Word from VB6 for mail merge with code which has been used for
years errors with Office 2007 Student edition only (Standard Office 2007
works fine as do all other versions of Office)

Error is:
"Run-time error '5535': Word could not finish merging these documents or
inserting this database"

Code:
Early binding is used using the Word 97 object model for maximum version
compatibility.

Set objMerge = objDoc.MailMerge
objMerge.OpenDataSource Name:=MergeDataFile, ConfirmConversions:=False,_
ReadOnly:=True, AddToRecentFiles:=False, Revert:=False,_
Format:=wdOpenFormatText

With objMerge
.Destination = wdSendToNewDocument
.Execute
.ViewMailMergeFieldCodes = False
objWord.ActiveDocument.PrintOut Background:=False, Copies:=Copies
End With

The error is in the .Execute command
Prior to this command the template doc had linked to the datafile OK.
The template is a .doc file not a .docx file (i.e. in Compatibility mode).

If I do not merge to a new document first, but merge directly to the
printer, the code works OK

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top