Hi everyone - requesting help again because you are all so awesome!
I have the following code that opens an embedded Word doc and prints it (along with the main spreadsheet).
I am trying to figure out how I can tell it to only print pages 1-2 of the Word doc (instead of the whole thing).
I'm guessing it will have to go somewhere in the purple text below, but I don't know what to put.
Would you please help? Thank you!!
Sub PrintAll()
Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Sheet1").Select
Call OpenPrintCloseWordDoc
End Sub
Sub OpenPrintCloseWordDoc()
wd = Sheets("Sheet1").Shapes("Object 11").OLEFormat.Verb(Verb:=xlVerbOpen)
Set wdApp = GetObject(, "Word.Application")
Set wdDoc = wdApp.Documents(1)
wdDoc.PrintOut
wdDoc.Close
End Sub
I have the following code that opens an embedded Word doc and prints it (along with the main spreadsheet).
I am trying to figure out how I can tell it to only print pages 1-2 of the Word doc (instead of the whole thing).
I'm guessing it will have to go somewhere in the purple text below, but I don't know what to put.
Would you please help? Thank you!!
Sub PrintAll()
Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Sheet1").Select
Call OpenPrintCloseWordDoc
End Sub
Sub OpenPrintCloseWordDoc()
wd = Sheets("Sheet1").Shapes("Object 11").OLEFormat.Verb(Verb:=xlVerbOpen)
Set wdApp = GetObject(, "Word.Application")
Set wdDoc = wdApp.Documents(1)
wdDoc.PrintOut
wdDoc.Close
End Sub