View Single Post
  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

I may be missing something, but

immediately after this...

Set app = CreateObject("Word.Application")

no document is open in app, so there is no ActiveDocument, so there is no
MailMerge object for the set merge line. If you are starting from a blank
document, you will probably need at least

app.Documents.Add

and preferably

Dim oDoc as Word.Document
Set oDoc = app.Documents.Add

If you are starting from an existing document you could use

Dim oDoc as Word.Document
Set oDoc = app.Documents.Open("pathname of the .doc")

Peter Jamieson

"Don Petersen via OfficeKB.com" wrote in message
...
Sorry for cutting out a little code:

Set app = CreateObject("Word.Application")
Set merge = app.ActiveDocument.MailMerge
With merge
.MainDocumentType = wdCatalog

should fill in the blanks some.

I tried your suggestion:

doc.MailMerge.MainDocumentType = wdDirectory
and even:
doc.MailMerge.MainDocumentType = wdCatalog

and the type did not change. It is still wdFormLetters.

--
Message posted via http://www.officekb.com