Hi,
The ActiveDocument.PrintOut command in the sub below generates an error. What is the easiest way to print a Word doc from within Access (VBA) that involves no merging? Just need to print the doc.
Thanks!
Public Sub PrintWordDoc(ByVal strDocPathAndName As String)
On Error GoTo PrintWordDoc_Error
Dim objWord As New Word.Application
Dim objDoc As Word.Document
objWord.Application.Visible = True
Set objDoc = objWord.Documents.Open(strDocPathAndName)
ActiveDocument.PrintOut
objWord.Application.Documents(1).Close wdDoNotSaveChanges
objWord.Quit
Set objWord = Nothing
Set objDoc = Nothing
PrintWordDoc_Error:
MsgBox "Error #" & Err.Number & " occurred." & Err.Description, vbOKOnly, "Word Error"
objWord.Quit
End Sub
The ActiveDocument.PrintOut command in the sub below generates an error. What is the easiest way to print a Word doc from within Access (VBA) that involves no merging? Just need to print the doc.
Thanks!
Public Sub PrintWordDoc(ByVal strDocPathAndName As String)
On Error GoTo PrintWordDoc_Error
Dim objWord As New Word.Application
Dim objDoc As Word.Document
objWord.Application.Visible = True
Set objDoc = objWord.Documents.Open(strDocPathAndName)
ActiveDocument.PrintOut
objWord.Application.Documents(1).Close wdDoNotSaveChanges
objWord.Quit
Set objWord = Nothing
Set objDoc = Nothing
PrintWordDoc_Error:
MsgBox "Error #" & Err.Number & " occurred." & Err.Description, vbOKOnly, "Word Error"
objWord.Quit
End Sub