Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run-time error '5852'

0 views
Skip to first unread message

Mo

unread,
Aug 22, 2006, 11:46:15 AM8/22/06
to
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: m.a.j...@qmul.ac.uk

John Nurick

unread,
Aug 22, 2006, 3:31:02 PM8/22/06
to
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?


On Tue, 22 Aug 2006 16:46:15 +0100, Mo <99m.a....@99qmul.ac.uk>
wrote:

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

Mo

unread,
Aug 23, 2006, 4:09:08 AM8/23/06
to
John Nurick wrote:

> 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?

Mo

unread,
Aug 23, 2006, 4:09:23 AM8/23/06
to
Message has been deleted

Mo

unread,
Aug 23, 2006, 6:00:14 AM8/23/06
to
OK John, it's sorted.

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

Thanks for your help.

Mo

will

unread,
Aug 23, 2006, 11:10:02 AM8/23/06
to
What version of Office where you using before? Office 2000 and 2003 use
difference versions of the code, so there will be slight changes in code do
to depreciation of functions/new use/new parameters etc.

patl

unread,
Dec 13, 2006, 12:20:46 PM12/13/06
to

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

chematercero;3969900 Wrote:
> what do you mean by recreate?


--
patl
------------------------------------------------------------------------
patl's Profile: http://www.officehelp.in/member.php?userid=5524
View this thread: http://www.officehelp.in/showthread.php?t=1175407

Posted from - http://www.officehelp.in

0 new messages