Word 2003 error 5852 requested object is not available

D

Dominic Hawtin

I have some code that is fairly simple and it works fine
on with Access/Word 2000 and Access/Word 2002/XP. Trying
it under Access/Word 2003 produces the above error.

My Code is:

Set wrdapp = CreateObject("Word.Application")
wrdapp.Visible = True
Set wrdDoc = wrdapp.Documents.Add
(Template:=strDir & "\" & strLetter & ".dot",
NewTemplate:=False)

With wrdDoc
.SaveAs (strDir + "\" + "temp.doc")
.MailMerge.Destination =
wdSendToNewDocument
.MailMerge.Execute
.Close ' close the document
Kill strDir + "\" + "temp.doc"
End With
Exit Sub

It errors on the line .mailmerge.destination =
wdsendtonewdocument.

The document that is is opening is linked to a database
that gets all data deleted and only ONE record sent to it
before the link.
The merge document was created with Word 2000 and I
selected "Select Method" and choose "MS Access Database
via ODBC".

I use to use via DDE however this often opens up a copy
of the database and does not close it. Again, all this
has been working until Word 2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top