A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Run-time error '5852'



 
 
Thread Tools Display Modes
  #1  
Old August 22nd, 2006, 04:46 PM posted to microsoft.public.access.forms
Mo
external usenet poster
 
Posts: 31
Default Run-time error '5852'

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:
  #2  
Old August 22nd, 2006, 08:31 PM posted to microsoft.public.access.forms
John Nurick
external usenet poster
 
Posts: 492
Default Run-time error '5852'

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
wrote:

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:


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
  #3  
Old August 23rd, 2006, 09:09 AM posted to microsoft.public.access.forms
Mo
external usenet poster
 
Posts: 31
Default Run-time error '5852'

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?

  #4  
Old August 23rd, 2006, 11:00 AM posted to microsoft.public.access.forms
Mo
external usenet poster
 
Posts: 31
Default Run-time error '5852'

OK John, it's sorted.

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

Thanks for your help.

Mo
  #5  
Old November 17th, 2006, 05:17 PM posted to microsoft.public.access.forms
chematercero
external usenet poster
 
Posts: 1
Default Run-time error '5852'

what do you mean by recreate?

"Mo" wrote:

OK John, it's sorted.

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

Thanks for your help.

Mo

  #6  
Old December 13th, 2006, 05:20 PM posted to microsoft.public.access.forms
patl
external usenet poster
 
Posts: 1
Default Run-time error '5852'


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?

"Mo" wrote:

OK John, it's sorted.

I recreated the word doc and everything works fine (fingers

crossed).

Thanks for your help.

Mo



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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.