S
strider235
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:
Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument
For 2002 I get a msg "Requested object is not available" on the last line.
I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument
and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don
mailmerge. It works great for Word/Access 2000. Here is a fragment:
Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument
For 2002 I get a msg "Requested object is not available" on the last line.
I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument
and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don