How do i edit Text Form Field (legacy forms) in my document, so that i can then use new value of this field in my VBA script?
I have simple form with Text Form Field (Bookmark = TextFormField1). It is showing default text "default text".
I can access text of this field like this: ActiveDocument.FormFields("TextFormField1").Range.Text
However, if i change value of this field, it seems to delete the field itself, and replacing it with simple text - causing ActiveDocument.FormFields("TextFormField1").Range.Text
to throw exception, because TextFormField1 does not exist anymore...
What am i doing wrong? How can i insert text in form field, and use this text in my VBA script?
Try next code:
ThisDocument.FormFields("Index_Or_FormFieldName_or_Bookmarkname").TextInput.EditType Type:=wdRegularText, Default:="Your Form field text"
But it rec the value in to the FormField very slowly.
使用Result
属性:
ActiveDocument.FormFields("TextFormField1").Result = "Form field text"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.