J
jerem
I would like to use the code below to delete only a certain field code
appearing in each Section's footer. I don't want the page numbering field
codes deleted, I just want the document ID # deleted. When I use the Find
stipulating a field code (^d) it finds any and every field code including
page number field codes. Is there any way to stipulate a specific field code?
The code below works wonderfully for deleting all footers but I want to
replace the
statement of Then oFoot.Range.Delete with something like this: find
specifically the document ID#, which appears in the document in this form: {
DOCPROPERTY "SWDocID" \*MERGEFORMAT }, and then delete it, but I don't know
how to be field code specific.
Any help would be appreciated.
Sub DeleteFooters()
Dim oSec As Section
Dim oFoot As HeaderFooter
For Each oSec In ActiveDocument.Sections
For Each oFoot In oSec.Footers
If oFoot.Exists Then oFoot.Range.Delete
Next oFoot
Next oSec
End Sub
appearing in each Section's footer. I don't want the page numbering field
codes deleted, I just want the document ID # deleted. When I use the Find
stipulating a field code (^d) it finds any and every field code including
page number field codes. Is there any way to stipulate a specific field code?
The code below works wonderfully for deleting all footers but I want to
replace the
statement of Then oFoot.Range.Delete with something like this: find
specifically the document ID#, which appears in the document in this form: {
DOCPROPERTY "SWDocID" \*MERGEFORMAT }, and then delete it, but I don't know
how to be field code specific.
Any help would be appreciated.
Sub DeleteFooters()
Dim oSec As Section
Dim oFoot As HeaderFooter
For Each oSec In ActiveDocument.Sections
For Each oFoot In oSec.Footers
If oFoot.Exists Then oFoot.Range.Delete
Next oFoot
Next oSec
End Sub