Hi
Im having the below vba code that runs the macro when pressing the button on excel sheet whitch is hyperlinked to word doc. It seems to work but its aslo opens the document. What I wish to achieved is to print it without opening the document.
I trying few difrence ways but atuck with it.
The next think. Is this posible to use with linked pdf
Much appreciate for help.
Sub test()
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
OpenWordDoc WordApp, "here is the file path word doc."
WordApp.Quit
Set WordApp = Nothing
End Sub
Public Sub OpenWordDoc(WD As Object, strPath As String)
WD.Documents.Open (strPath)
WD.ActiveDocument.PrintOut Background:=False
WD.ActiveDocument.Close
End Sub
Im having the below vba code that runs the macro when pressing the button on excel sheet whitch is hyperlinked to word doc. It seems to work but its aslo opens the document. What I wish to achieved is to print it without opening the document.
I trying few difrence ways but atuck with it.
The next think. Is this posible to use with linked pdf
Much appreciate for help.
Sub test()
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
OpenWordDoc WordApp, "here is the file path word doc."
WordApp.Quit
Set WordApp = Nothing
End Sub
Public Sub OpenWordDoc(WD As Object, strPath As String)
WD.Documents.Open (strPath)
WD.ActiveDocument.PrintOut Background:=False
WD.ActiveDocument.Close
End Sub