I have this macro which updates the fields in the footer. I doubt it is the
best way to make this happen...also it doesn't work in all sections. Any
advice would be appreciated! Thanks



If Documents.Count = 0 Then Exit Sub

If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End If
Selection.WholeStory
Selection.Fields.Update
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Re: Update fields in footers by Doug

Doug
Mon May 19 12:40:09 PDT 2008

Sometimes, just using

With ActiveDocument
.PrintPreview
.ClosePrintPreview
End With

is an easy way of doing it.

Or you may use

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
With .Sections(i)
.Headers(wdHeaderFooterFirstPage).Range.Fields.Update
.Headers(wdHeaderFooterPrimary).Range.Fields.Update
.Footers(wdHeaderFooterFirstPage).Range.Fields.Update
.Footers(wdHeaderFooterPrimary).Range.Fields.Update
End With
Next
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Sammy" <Sammy@discussions.microsoft.com> wrote in message
news:E3CD0E7A-DB19-4DBE-87FA-D5E9BDBCE772@microsoft.com...
>I have this macro which updates the fields in the footer. I doubt it is
>the
> best way to make this happen...also it doesn't work in all sections. Any
> advice would be appreciated! Thanks
>
>
>
> If Documents.Count = 0 Then Exit Sub
>
> If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
> ActiveWindow.Panes(2).Close
> End If
> If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
> ActivePane.View.Type = wdOutlineView Then
> ActiveWindow.ActivePane.View.Type = wdPrintView
> End If
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> If Selection.HeaderFooter.IsHeader = True Then
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
> Else
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> End If
> Selection.WholeStory
> Selection.Fields.Update
> ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument



Re: Update fields in footers by Sammy

Sammy
Mon May 19 12:57:01 PDT 2008

Wonderful! Thanks

"Doug Robbins - Word MVP" wrote:

> Sometimes, just using
>
> With ActiveDocument
> .PrintPreview
> .ClosePrintPreview
> End With
>
> is an easy way of doing it.
>
> Or you may use
>
> Dim i As Long
> With ActiveDocument
> For i = 1 To .Sections.Count
> With .Sections(i)
> .Headers(wdHeaderFooterFirstPage).Range.Fields.Update
> .Headers(wdHeaderFooterPrimary).Range.Fields.Update
> .Footers(wdHeaderFooterFirstPage).Range.Fields.Update
> .Footers(wdHeaderFooterPrimary).Range.Fields.Update
> End With
> Next
> End With
>
>
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Sammy" <Sammy@discussions.microsoft.com> wrote in message
> news:E3CD0E7A-DB19-4DBE-87FA-D5E9BDBCE772@microsoft.com...
> >I have this macro which updates the fields in the footer. I doubt it is
> >the
> > best way to make this happen...also it doesn't work in all sections. Any
> > advice would be appreciated! Thanks
> >
> >
> >
> > If Documents.Count = 0 Then Exit Sub
> >
> > If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
> > ActiveWindow.Panes(2).Close
> > End If
> > If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
> > ActivePane.View.Type = wdOutlineView Then
> > ActiveWindow.ActivePane.View.Type = wdPrintView
> > End If
> > ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> > If Selection.HeaderFooter.IsHeader = True Then
> > ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
> > Else
> > ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> > End If
> > Selection.WholeStory
> > Selection.Fields.Update
> > ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
>
>
>