View Single Post
 
Old 11-22-2016, 03:10 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,355
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There is no need to set the View.Type or use SeekView for what you're doing. Try:
Code:
Dim fg As Field
With WordDoc
  .Sections(2).Headers(wdHeaderFooterPrimary).LinkToPrevious = False
  With .Sections(1).Headers(wdHeaderFooterPrimary).Range
  For Each fg In .Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields
    If (InStr(1, fg.Code.text, "{ORDERNR}") > 0) Then
      fg.Code.Text = Replace(fg.Code.Text, "{ORDERNR}", "{FONR}")
      fg.Update
    End If
  Next fg
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote