Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. MsgBox "A Title merge field is in this document" This example determines whether the active document includes a mail merge field named "Title." Dim fieldLoop As Fieldįor Each fieldLoop In field codes, locking fields, and other common tasks, see Insert, edit, and view fields in Word. Note: For detailed information about inserting and editing field codes, using switches, setting and changing properties, displaying results vs. Set rngTemp = ActiveDocument.Fields(1).Code Follow the link to the field code you're interested in, in the alphabetized list below. This example changes the field code for the first field in the active document to CREATEDATE. Dim fieldLoop As Fieldįor Each fieldLoop In ActiveDocument.Fields This example displays the field code for each field in the active document. You can access a field's code without changing the view from field results. RemarksĪ field's code is everything that's enclosed by the field characters ( ) including the leading space and trailing space characters. SyntaxĮxpression A variable that represents a ' Field' object. Returns a Range object that represents a field's code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |