• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Macro to print hyperlinked word doc.

Mike35

New Member
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
 
Back
Top