M
ML
The following code has worked perfectly (it was derived from macros) until
Word was upgraded to 2003.
Set oApp = CreateObject("Word.Application")
' With oApp
' .Visible = True
' .Activate
' .WindowState = wdWindowStateMaximize
' End With
oApp.ChangeFileOpenDirectory SourceDocsDirectory
oApp.Documents.Open Filename:="A_Word_Merge_Doc.doc",
ConfirmConversions:=False, ReadOnly:= _
True, AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="",
WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto
With oApp.Documents(1).MailMerge
.Destination = wdSendToNewDocument
.Execute
.MainDocumentType = wdNotAMergeDocument
End With
The doc, called A_Word_Merge_Doc.doc here, was set up using Word 2000 mail
merger to query a table in an Access mdb.
With Word 2003, it now appears to lose track that it is a "merge" doc, and
fails with a 5852 Requested Object is not available"
at the (mailmerge) ,destination = wdSendTonewDocument statement.
I have tried recreating the "merge" doc, both as a Jet and as an ODBC
connected doc.
I still can't get a Word 2003 mailmerge doc, to open in and Access VBA set
of statements.
Can anyone help
TIA
Michael
Word was upgraded to 2003.
Set oApp = CreateObject("Word.Application")
' With oApp
' .Visible = True
' .Activate
' .WindowState = wdWindowStateMaximize
' End With
oApp.ChangeFileOpenDirectory SourceDocsDirectory
oApp.Documents.Open Filename:="A_Word_Merge_Doc.doc",
ConfirmConversions:=False, ReadOnly:= _
True, AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="",
WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto
With oApp.Documents(1).MailMerge
.Destination = wdSendToNewDocument
.Execute
.MainDocumentType = wdNotAMergeDocument
End With
The doc, called A_Word_Merge_Doc.doc here, was set up using Word 2000 mail
merger to query a table in an Access mdb.
With Word 2003, it now appears to lose track that it is a "merge" doc, and
fails with a 5852 Requested Object is not available"
at the (mailmerge) ,destination = wdSendTonewDocument statement.
I have tried recreating the "merge" doc, both as a Jet and as an ODBC
connected doc.
I still can't get a Word 2003 mailmerge doc, to open in and Access VBA set
of statements.
Can anyone help
TIA
Michael