A
afswa
I need a subroutine to lock fields in the headers and footers once they have
updated. I have been trying
For Each sSection In ActiveDocument.Sections
For Each hHeader In sSection.Headers
If hHeader.Exists Then
For Each fField In hHeader.Range.Fields
fField.Unlink
Next fField
End If
Next hHeader
For Each fFooter In sSection.Footers
If fFooter.Exists Then
For Each fField In fFooter.Range.Fields
If fField.Type <> wdFieldPage Then
fField.Unlink
End If
Next fField
End If
Next fFooter
Next sSection
But it is painfully slow - there are 164 sections in the document but it is
taking around 40 minutes on a P4 with 1 Gig RAM
Is there a better way?.
updated. I have been trying
For Each sSection In ActiveDocument.Sections
For Each hHeader In sSection.Headers
If hHeader.Exists Then
For Each fField In hHeader.Range.Fields
fField.Unlink
Next fField
End If
Next hHeader
For Each fFooter In sSection.Footers
If fFooter.Exists Then
For Each fField In fFooter.Range.Fields
If fField.Type <> wdFieldPage Then
fField.Unlink
End If
Next fField
End If
Next fFooter
Next sSection
But it is painfully slow - there are 164 sections in the document but it is
taking around 40 minutes on a P4 with 1 Gig RAM
Is there a better way?.