LegalLearning
Sun Feb 12 12:39:27 CST 2006
I am now having trouble getting the page number back into the second cell of
a one row table in the footer. This is with as many sections as there might
be in the document but only on wdPrimaryFooterStory. Can you help me with
that?
--
CLG
"Greg Maxey" wrote:
> The first macro will delete all fields in a document. The second should do
> what you have specifically asked for.
>
> Sub DeleteAllFields()
> Dim pRange As Word.Range
> For Each pRange In ActiveDocument.StoryRanges
> Do
> With pRange.Fields
> While .Count > 0
> .Item(1).Delete
> Wend
> End With
> Set pRange = pRange.NextStoryRange
> Loop Until pRange Is Nothing
> Next
> End Sub
> Sub DeleteSelectedFields()
> Dim pRange As Word.Range
> Dim oFld As Field
> For Each pRange In ActiveDocument.StoryRanges
> Select Case pRange.StoryType
> Case wdFirstPageFooterStory, _
> wdPrimaryFooterStory, wdEvenPagesFooterStory
> For Each oFld In pRange.Fields
> Select Case oFld.Type
> Case wdFieldPage, wdFieldDate, _
> wdFieldFileName
> oFld.Delete
> Case Else
> 'Do Nothing
> End Select
> Next
> Case Else
> 'Do nothing
> End Select
> Next
> End Sub
>
> --
> Greg Maxey/Word MVP
> See:
>
http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
>
>
> Legal Learning wrote:
> > as well as file and path name field. These fields are located in the
> > first cell of a one row table located in every footer in every
> > section (also first page footer exists). How can I delete all of
> > these fields in a macro?
> >
> > I appreciate any help regarding this.
> >
> > Using Word 2003
>
>
>