PDA

View Full Version : URGENT - Getting footer onto the first page



newk
02-07-2006, 02:47 AM
Hello everyone, please help me.

Please see attached test document (I hope the code has come through with it).

I need the footer to only be written on the first page of the document, however at the moment it will only write to the last page.

I am novice at scripting so any help would be greatly appreciated, as would any baby feeding.

Thank you


Kieran

TonyJollans
02-07-2006, 04:19 AM
Hi newk,

The attached document has no code. Nor, for the footer, does it need any.

It has three section breaks on Page 1 (making four sections in total). Sections 1 and 4 have different first page footers (I haven't looked at sections 2 and 3 because they don't show).

You have a graphic in the first page footer of section 1.
You have some text in the standard footer of section 4.

I would suggest you simply move the text from section 4 standard footer to section 1 first page footer but am unclear as to exactly what you want or why you have so many sections.

newk
02-07-2006, 04:48 AM
Thanks Tony for taking a look,

Basically the user has 5 options for footers (1 for each office location) and it will write the appropriate address for each. I have used the following code.





Select Case True

Case Is = Me.optBrighton

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter

Selection.MoveDown Unit:=wdLine, Count:=9

Selection.Range.Text = "Sovereign House, "

Selection.EndKey Unit:=wdLine, Extend:=wdExtend

With Selection

.Font.Size = 8

.Paragraphs.Alignment = wdAlignParagraphLeft

End With

Selection.MoveDown Unit:=wdLine, Count:=1

Selection.TypeParagraph

Selection.Range.Text = "Tel: Fax: Email: "

Selection.EndKey Unit:=wdLine, Extend:=wdExtend

With Selection

.Font.Size = 8

.Paragraphs.Alignment = wdAlignParagraphLeft

End With

ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

End Select

Unload Me

End Sub





When I created the original document it only spanned one page, so the footer always sat at the bottom of page 1. However the document has now been adapted and now spans 3 pages.

The footer should only be on the first page. However now the document is 3 pages it only writes to the 3rd page.

I assume the problem is with the ?wdSeekCurrentPageFooter? command. But I am unsure and don?t know the command for ??wdSeekFirstPageFooter??

I hope this makes my problems clearer.

Kieran

TonyJollans
02-07-2006, 05:00 AM
Personally I'd ditch the Seek stuff - that messes with the user view which you (probably) don't want to do. Something like this ought to do it ... With ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range
.Text = "Sovereign House, " & vbCr & "Tel: Fax: Email: "
.Font.Size = 8
.Paragraphs.Alignment = wdAlignParagraphLeft
End With