Access 2003 and Word 2003 - bug or my error????

C

_Carolyn

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
 

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