PDA

View Full Version : mail merge



bareket
07-16-2007, 04:40 AM
I'm trying to make mail merge through a macro.
The data source, and the header source, are two separate files,
and their fields are separated with %.
When I used this macro in word2000, it worked great.
I'm trying to use the same macro in wordXp.
The document does open, but not with the data that in the file.
(It seems that it's opened as a formal letter, instead of main document for mail merge).
When I'm trying to "force" it to open like I want, with :
With ActiveDocument.MailMerge
.OpenHeaderSource Name:=headerName, Revert:=False, addtorecentfiles:=False
.OpenDataSource Name:=sourceName,
.ViewMailMergeFieldCodes = wdToggle
End With
It does open, but ask for header and fields separators.

Any idea how to open it correctly ?

The macro that open the document, contain :
Documents.Open FileName:=DocFullName, ReadOnly:=True, addtorecentfiles:=True