Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Leila
 
Posts: n/a
Default How to delete page number in the header of first page?

Hi there,
Would you please let me know what I'm dong wrong in this code?
I want to delete "Page {PAGE}" in the first page header if different First
page option is checked off. Any help would be appreciated!
-------------------------
Sub Delete1stPgNo()

Dim oField As Field
If ActiveDocument.PageSetup.DifferentFirstPageHeaderF ooter = True Then

ActiveDocument.ActiveWindow.ActivePane.View.SeekVi ew =
wdSeekFirstPageHeader
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Page"
.Replacement.Text = ""
End With
With Selection.Range.Fields
If oField.Type = wdFieldPage Then
oField.Delete

End If
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

End If

End Sub




 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete first page number Leila Microsoft Word Help 4 April 14th 05 07:27 PM
Page Number and Page header on the first page Frank Drost Formatting Long Documents 3 March 1st 05 02:17 PM
Possible to have incrementing number in header (not page#)? James Page Layout 1 February 9th 05 02:37 PM
Go To Page function obligates you to delete previous entry Kamran Microsoft Word Help 3 February 3rd 05 06:17 PM
FIrst page footers Noel S Pamfree Microsoft Word Help 7 December 6th 04 08:49 PM


All times are GMT +1. The time now is 08:17 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"