IF First Page Header and IF Page 1

D

Debra Farnham

Hi All

Win2k Word2K

Is there a way, programatically, to insert a specific header IF the current
page is numbered page 1 AND it is a first page header ELSE some other
header?
The page could be numbered page 1 but not necessarily page count 1 due to a
variety of section breaks prior to this area of the document.

All headers (regardless of whether they're first page headers or not in
their specific sections) will contain the page number. It's what follows in
the next two or three paragraphs following the page numbering in the header
that will vary.

TIA for any assistance.

Debra
 
J

Jezebel

Programmatically, you can do anything you like with the headers. It's not
quite clear what you're trying to achieve here: I don't understand what you
mean by "if it's a first page header", nor the significance of the
paragraphs following the header.

Is this the task? -- For each page in the document, if the page is numbered
"1" and that page is the first page of a section that has 'different first
page' headers, then insert new header A, else insert new header B.
 
D

Doug Robbins - Word MVP

Use the following test

Dim aheader As HeaderFooter
For Each aheader In ActiveDocument.Sections(1).Headers
If aheader.Index = wdHeaderFooterFirstPage And
aheader.Range.Information(wdActiveEndAdjustedPageNumber) = 1 Then
MsgBox "It's the firstpage header with pagenumber 1"
End If
Next aheader


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

Debra Farnham

As always Doug ... exactly what I was looking for.

Not quite sure what'd I'd do without you *S*

Debra
 

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