Syntax
SetFormResult BookmarkName$, Result[$] [, DefaultResult]
Remarks
Sets the result of the form field marked by the bookmark BookmarkName$ or updates any fields embedded within the specified form field. Depending on the type of form field, you specify Result[$] as a string or number, as follows:
If you do not specify Result[$], SetFormResult updates any fields within the specified form field.
If DefaultResult is 1, the result becomes the default result for the field. The default result is displayed each time the document containing the form field is protected for forms.
Examples
The following example is an AutoNew macro that runs each time a form is created. It sets the default results for the text form field "NameText," the check box form field "AgeCheck," and the drop-down form field "PreferencesList." It then protects the document for forms.
Sub MAIN SetFormResult "NameText", "John Jones", 1 SetFormResult "AgeCheck", 1, 1 SetFormResult "PreferencesList", 2, 1 ToolsProtectDocument .Type = 2 End Sub
The following example updates a text form field identified by the bookmark "DateField." The form field contains a date field, which is updated by the SetFormResult instruction.
SetFormResult "DateField"
See Also
GetFormResult()