deleting cross-reference fields

In a WORD 2010 document, is there a way to delete all cross-reference fields at one time, while preserving the text?  thanks.
Answer
Answer
Use this macro (see http://www.gmayor.com/installing_macro.htm if needed):

Sub x()
    Dim fld As Field
    For Each fld In ActiveDocument.Fields
        If fld.Type = wdFieldRef Then
            fld.Unlink
        End If
    Next
End Sub

_____________________________
https://jay-freedman.info

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 414 Applies to: