
/001-insert-source-code-into-word-document-3994582-1a2d127c226f4846bf9bec7d9a281fc5.jpg)
- #How to find field code in word for mac 2018 how to#
- #How to find field code in word for mac 2018 update#
MsgBox "A Title merge field is in this document" Sub GetSetDocVars () Dim fName As String fName 'Jeff Smith' Set contents of variable 'fName' in a document using a document variable.
#How to find field code in word for mac 2018 how to#
Source: How to store and retrieve variables in Word documents. Set the top, bottom, left, and right margins. Also, you can use the DocVariable field to retrieve the value of a document variable after it has been set to display within a Word document. To set the margins for the document, click the Margins tab in the Page Setup dialog box. Then in the Text group click on Quick Parts then Field. To enter a Word count, make sure you have the cursor where you want the count to appear.
#How to find field code in word for mac 2018 update#
This example determines whether the active document includes a mail merge field named "Title." Dim fieldLoop As Fieldįor Each fieldLoop In To set options for Page Setup in Word using a dialog box, click the Page Setup dialog box button in the lower right corner of the Page Setup group to open the Page Setup dialog box. Insert Word Count You can use a field code to enter the current word count in a document, and it will continue to update as you add more to the document. Set rngTemp = ActiveDocument.Fields(1).Code 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.
