L
Linda
I'm trying to automate a mailmerge process that should
create a new merged document and save it to C:\TEMP
For some reason I'm always getting the following error
message:
Automation Error - The RPC server is unavailable.
This is the routine:
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Application.Visible = True
objWord.Application.Documents.Open "\\serv01
\applications\MailMerges\OutstandingBill.doc"
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ChangeFileOpenDirectory "C:\TEMP\"
ActiveDocument.SaveAs
FileName:="outstandingbill.doc", FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
Application.Quit
Set objWord = Nothing
ANY HELP IS MOST APPRECIATED!
create a new merged document and save it to C:\TEMP
For some reason I'm always getting the following error
message:
Automation Error - The RPC server is unavailable.
This is the routine:
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Application.Visible = True
objWord.Application.Documents.Open "\\serv01
\applications\MailMerges\OutstandingBill.doc"
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ChangeFileOpenDirectory "C:\TEMP\"
ActiveDocument.SaveAs
FileName:="outstandingbill.doc", FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
Application.Quit
Set objWord = Nothing
ANY HELP IS MOST APPRECIATED!