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
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.
> 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?
I recreated the word doc and everything works fine (fingers crossed).
Thanks for your help.
Mo
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