Hi All have a problem,
I have an Access DB that automatically runs a mailmerge to Word. Within Word I have also written a macro that when the Word document is open from Access lets call it Data.doc for was, it runs the commands:
'merge to new document'
close Data.doc
However when I execute this I get the error
Runtime error 5852
Request object not available
Following is my macro:
Private Sub Document_Open()
'
' Macro1 Macro
' Macro recorded 10/10/2004 by karv
'
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument '*This is where debug points to
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
On Error GoTo Err
.Execute Pause:=False
End With
Application.Visible = True
Err:
Windows("Data.doc").Close
End Sub
Any help would be greatful
Regards
Karv
I have an Access DB that automatically runs a mailmerge to Word. Within Word I have also written a macro that when the Word document is open from Access lets call it Data.doc for was, it runs the commands:
'merge to new document'
close Data.doc
However when I execute this I get the error
Runtime error 5852
Request object not available
Following is my macro:
Private Sub Document_Open()
'
' Macro1 Macro
' Macro recorded 10/10/2004 by karv
'
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument '*This is where debug points to
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
On Error GoTo Err
.Execute Pause:=False
End With
Application.Visible = True
Err:
Windows("Data.doc").Close
End Sub
Any help would be greatful
Regards
Karv
Last edited: