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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|