You can, of course, assign the macro to the Quick Access Toolbar or a shortcut key so it can be called into action as quickly as possible. The following is a simple, short macro that goes through all the parts of your document and removes all the fields.įor Each rng In ActiveDocument.StoryRanges If you have to get rid of fields in this way quite often, it makes sense to create a macro that will handle the task for you.
#REMOVING FIELD CODES IN WORD 2010 CODE#
This is the code that Word understands as "any field." In the Find What box, enter ^d as what you are searching for (make sure you use a lowercase d).The Replace tab of the Find and Replace dialog box. Word displays the Replace tab of the Find and Replace dialog box. This makes all the field codes in your document visible, instead of the results of those fields. If you simply want to get rid of all the fields and don't care that they be replaced with anything, you can use the Find and Replace capabilities of Word. Everyplace there was a field, the field is deleted and replaced with the result of the field. If you mean that you want to get rid of the fields and replace them with plain text that represents the result of the field, then the easiest method is to select the entire document ( Ctrl+A) and then press Ctrl+Shift+F9 to "unlink" the fields.
The answer to how you do this depends almost entirely on what you mean by "deleting" a field. When you are working with documents-particularly long documents created by someone else-you may have a need to delete all the fields in the document.