Hiding/Showing sections or multipe pages

D

Doug

I think this is a simple problem....

I am working on a Word doc that is several pages of forms. These forms are
broken down into sections usually 1 to 4 pages in length. What I would like
to do is add a listbox or control button on the first page that will make
only certain sections visible. I could set the Page.Visible property to
false for each page in a given "section," but a problem arises if someone
else needs to edit the forms, possibly extending the section onto another
page. I don't want to have to change the code each time this happens.

Is there anyway to group several pages into one object, and then hide that
object? If so, is there an easy way for someone editing the document to
add/remove pages from that object or section?

Thanks!
Doug
 
D

Dave Lett

Hi Doug,

There is no "page" object in the Word object model. However, since you have
a document in sections, you can simply hide/unhide the range when you need
to.

ActiveDocument.Sections(3).Range.Font.Hidden = True

HTH
 

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