Macro to delete cross-reference error message when bookmark deleted
I have a document which uses many cross references linked to bookmarks. When the document is edited, some of these bookmarks are intentionally deleted. When all of the fields in the document are updated, the deleted bookmarks generate "Error! Reference source not found" where the cross reference field occurs.
Using find and replace will remove the error message text but not the underlying {REF field}. If the fields are updated again or the document is printed, the deleted error message text reappears.
I do not want to unlink fields and do not want to remove all cross references. Going through the document to manually delete would take for ever. Can anyone help with a macro which locates all of these error messages and deletes the underlying cross reference fields? Would be hugely grateful if a solution could be found.
|