EnableFormField

Syntax

EnableFormField BookmarkName$, Enable

Remarks

Allows or prevents changes to the specified form field while the form is being filled in.

Argument

Explanation

BookmarkName$

The name of the bookmark that marks the form field.

Enable

Specifies whether the form field can be filled in or otherwise changed:

0 (zero) The form field cannot be changed.

1 The form field can be changed.


Example

This example allows or prevents changes to a form field based on the user name specified on the User Info tab in the Options dialog box (Tools menu). This macro could be part of an AutoNew macro that runs each time a document based on the form template is created.


Dim dlg As ToolsOptionsUserInfo
GetCurValues dlg
If dlg.Name = "Stella Richards" Then
    EnableFormField "TotalSales", 1
Else
    EnableFormField "TotalSales", 0
End If

See Also

InsertFormField