Run-time error '5852'

M

Mo

The situation is as follows:

I get a 'runtime error 5852. Run-time error '5852'. Requested object is
not available' message when I use Access 2003 to send data to a word
(2003) mailmerge document.

Prior to going over to Office 2003 we have not had any problems with
this functionality.

So far I've tried the suggestions in these two MS articles:

http://support.microsoft.com/kb/913804/

http://support.microsoft.com/kb/825765/

So far neither of these have worked.

Anyone have any idea what else it could be and how to resolve this?

The VBA I'm using is MS standard:

If CreateWordObj() Then
With gobjWord
.Visible = True
.Documents.Open "C:\screening\template.doc"
DoEvents
With gobjWord.ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
.Execute
End With
.ActiveDocument.PrintPreview
.Visible = True
End With
End If

Thanks for any help,

Mo








----------------------------------------
Mohamed Joomun
Database Programmer, CEPM
Wolfson Institute of Preventive Medicine
Barts and The London
Queen Mary's School of Medicine and Dentistry
Charterhouse Square, London EC1M 6BQ, UK

Tel: +44 (0)20 7882 6265
Fax: +44 (0)20 7882 6270
E-mail: (e-mail address removed)
 
J

John Nurick

Hi Mo,

Set a breakpoint on the line
If CreateWordObj() Then
and then step through the code line by line. Exactly which line is
raising the error?
 
M

Mo

John said:
Hi Mo,

Set a breakpoint on the line
If CreateWordObj() Then
and then step through the code line by line. Exactly which line is
raising the error?

The error is raise on this line;

.Destination = wdSendToNewDocument

Any ideas?
 
M

Mo

OK John, it's sorted.

I recreated the word doc and everything works fine (fingers crossed).

Thanks for your help.

Mo
 
P

patl

I read this thread with great interest because I have the same problem
(essentially the same code which ran perfectly well in an earlie
version of Office) However, recreating my Word mailmerge documen
didn't solve the problem. I have not made any changes to the registr
or obtained the newest Service Pack. Is that what is necessary?
 

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

Similar Threads


Top