Pinting excel sheets + embedded word document

DvdV

New Member
Joined
Nov 8, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,
I keep having problems with printing an excel file + the embedded word document. The excel file is about 15 pages, the embedded Word document about 10 pages. The problem is that from the embeddeb document only the first page is visible and printed.
How can I make sure the other 9 pages from the word document are included in the print version?

(excuse my bad English, it is not my mother-language)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The following code assumes that...

1) the workbook containing the embedded Word document is the active workbook

2) Sheet1 contains the embedded Word document

3) the embedded Word document is named Object 1

Here's the code...

VBA Code:
    Dim embeddedWordDocument As OLEObject
    Set embeddedWordDocument = ActiveWorkbook.Worksheets("Sheet1").OLEObjects("Object 1") 'change the workbook, sheet, and object names accordingly
  
    embeddedWordDocument.Verb xlVerbOpen
  
    Dim wordDocument As Object
    Set wordDocument = embeddedWordDocument.Object
  
    With wordDocument
        .PrintOut 'see link below for the optional arguments available
        .Close
    End With

See the following reference page for arguments available for the PrintOut method of the Document object...

Document.PrintOut method (Word)

Hope this helps!
 
Upvote 0
Thamk you Domimic.
Sadly this doesn't help me beacause I can't add a macro to the file. The excel-file is protected for adding macros. This prtection can't be lifted because the file is used by thousands of people.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top