Blind print out of pages

C

Cameron

I am to build a template for users to use and what it is to have is a button
that prints our specific sections of text. Basically, a user locates a
heading in the document and then clicks on the button and the code in the
button has to figure out how many pages are under that heading and print
them. How would I code something like that?
 
D

Doug Robbins - Word MVP

It would be easy if each heading was in a separate Section.

Dim i As Long
i = Selection.Information(wdActiveEndSectionNumber)
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Pages:="s" & i

If that is not the case, the easiest thing to do might be to use a macro to
insert a Section Break before each heading.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Cameron

Is there an example of how to insert section breaks using a macro? I know
they want to build these documents with tables of contents and then hyperlink
to the various headings.
 

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