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. Word Object Model Reference Support and feedback To count items in other stories use the collection with the Range object. The Count property for this collection in a document returns the number of items in the main story only. & "Result = " & ActiveDocument.Fields(1).Result & vbCr MsgBox "Code = " & ActiveDocument.Fields(1).Code & vbCr _ The easiest way would be, however, to search in the Word help function, as there you will find the exact description for what to do in YOUR Word version. Use the command 'Form field' or 'Field' from the menu 'Insert'. The following example displays the field code and the result of the first field in the active document. but I have only german Word, so maybe the english name is a different one. The index number represents the position of the field in the selection, range, or document. Use Fields (Index), where Index is the index number, to return a single Field object. Selection.Collapse Direction:=wdCollapseStart The following example inserts a DATE field at the beginning of the selection and then displays the result. Use the Add method to add a field to the Fields collection. Use the Fields property with a MailMerge object to return a MailMergeFields collection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |