Print Continuous Page Numbers Excel & Word Document

N

njvbguy

I need to print a Excel & Word document as 1 combined document. It is very
important the page numbers be accurate because it is a legal doument. The
Excel part prints first, and then a 5 or 6 page word document prints at the
end. The page number format on the entire document is "Page 4 of 20"
(4=Current Page, 20=Total pages both documents). I have all the code working
except I can't figure out how to start the Word document with page 16
(Assuming 15 is the last page of the Excel document that is printed). I never
did anything in Word VBA before this, I have been doing Excel VBA for years.
 
J

Jean-Guy Marcil

njvbguy said:
I need to print a Excel & Word document as 1 combined document. It is very
important the page numbers be accurate because it is a legal doument. The
Excel part prints first, and then a 5 or 6 page word document prints at the
end. The page number format on the entire document is "Page 4 of 20"
(4=Current Page, 20=Total pages both documents). I have all the code working
except I can't figure out how to start the Word document with page 16
(Assuming 15 is the last page of the Excel document that is printed). I never
did anything in Word VBA before this, I have been doing Excel VBA for years.

You need code like this:

With ActiveDocument.Sections(1).Headers(1).PageNumbers
.RestartNumberingAtSection = True
.StartingNumber = 16
End With

This code assumes that the numbering is in the primary header of the first
section of the document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top