Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
True if references to the specified form field are automatically updated whenever the field is exited. Read/write Boolean.
expression. CalculateOnExit
expression A variable that represents a 'FormField' object.
A REF field can be used to reference the contents of a form field. For example, {REF SubTotal} references the form field marked by the SubTotal bookmark.
This example keeps references to form fields in Form.doc from being automatically updated whenever the form field is exited.
Dim ffLoop As FormField
For Each ffLoop In Documents("Form.doc").FormFields
ffLoop.CalculateOnExit = False
Next ffLoop
This example adds a text form field and a REF field in a new document. Whenever text is typed and the Text1 field is exited, the REF field is automatically updated.
With Documents.Add
.FormFields.Add Range:=Selection.Range, _
Type:=wdFieldFormTextInput
.Fields.Add Range:=Selection.Range, _
Type:=wdFieldRef, Text:="Text1"
.FormFields("Text1").CalculateOnExit = True
.Protect Type:=wdAllowOnlyFormFields
End With
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.