Access 2003 -> Word Mailmerge 2003 bug??? or my error???

G

Guest

I am doing a mail merge from Access and keep getting an error:
5852 Requested object is not available.

I did a search on google and found many people have this error and I dont
see any resolution. " .Destination = wdSendToNewDocument 5852"

I would appreciate any help you might have.

Its Access 2003 calling Word 2003, in vba code.

It bombs out at -->.Destination = wdSendToNewDocument

Thank you,
Carolyn

-----code below------------

Sub DoLetter()
On Error GoTo errHandler

Dim oApp As Object
Set oApp = CreateObject("Word.Application")

oApp.Visible = True

oApp.Documents.Open FileName:="Conversion_ClientLetter1.doc",
ConfirmConversions _
:=False, ReadOnly:=True, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""


With oApp.ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With

DatabasePath.SetFocus
ChangeFileOpenDirectory DatabasePath.Text & "\"

oApp.ActiveDocument.SaveAs FileName:="Client Letter.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
oApp.ActiveDocument.PrintOut Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
oApp.ActiveDocument.Close

oApp.Application.Quit
Set oApp = Nothing

Exit Sub
 
B

Brendan Reynolds

Answered in another newsgroup.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 

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

Top