Mailmerge

J

Joop

Hi all
In Access VBA I execute a mailmerge:

Set doc = wrd.Documents.Open(cDir & "sjabOplFactuur2000.doc")
With doc.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
doc.Close SaveChanges:=False

This results in a document with the Word standard name.
My question: How can I give the docoment the name I want and how can I save
it at the location that I want?

regards Joop
 
W

Wayne Morgan

Open Word manually then open the code editor (Alt+F11). Search for Document
Object. Look at the method SaveAs. Here is the syntax for it.

expression.SaveAs(FileName, FileFormat, LockComments, Password,
AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts,
SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding,
InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks)

In your example,

Set doc = wrd.Documents.ActiveDocument
doc.SaveAs followed by the desired paramaters.

This is just a guess, even though you're doing this from Access, the Word
folks may be able to help you better. You may want to try the group
microsoft.public.word.vba.general.
 
Top