Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Display header for section 3 only

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex St-Pierre - 17 Dec 2006 13:41 GMT
Hi !
I'm using this command to put page number starting at page 3 and more. There
are wdSectionBreakNextPageSet after page 1 and page 2. Does anyone know why
the page number start at page 1 (section 1)?
   Set oRange = docWord.Sections(3).Headers(1).Range
   oRange.InsertAfter "Page "
   oRange.Collapse wdCollapseEnd
   oRange.Fields.Add Range:=oRange, Type:=wdFieldPage
Thanks!!
Alex
Signature

Alex St-Pierre

Stefan Blom - 18 Dec 2006 11:01 GMT
The starting page number must be specified on a section basis. For
example:

With ActiveDocument.Sections(3).Headers(1).PageNumbers
   .RestartNumberingAtSection = True
   .StartingNumber = 3   'specify the number you want!
End With

Signature

Stefan Blom
Microsoft Word MVP

> Hi !
> I'm using this command to put page number starting at page 3 and more. There
[quoted text clipped - 6 lines]
> Thanks!!
> Alex
Stefan Blom - 18 Dec 2006 11:13 GMT
Hmm, I just realized that I may have misunderstood your first
question. If the problem is that you want to keep the headers of the
first two sections blank, so that they do not reflect any insertions
made in section 3, you should use this code to unlink them:

docWord.Sections(1).Headers(1).LinkToPrevious = False
docWord.Sections(2).Headers(1).LinkToPrevious = False
docWord.Sections(3).Headers(1).LinkToPrevious = False

Then try to insert page numbers with your original code.

Note that each section actually has three different headers (and
footers); you may want to unlink those too, using Headers(2),
Headers(3) (and similarly for the footers). They won't display,
however, unless you enable the  DifferentFirstPageHeaderFooter and
OddAndEvenPagesHeaderFooter properties.

Signature

Stefan Blom
Microsoft Word MVP

> The starting page number must be specified on a section basis. For
> example:
[quoted text clipped - 16 lines]
> > Thanks!!
> > Alex

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.