WD: Toggling or Setting Word Dialog Box Check BoxesLast reviewed: February 2, 1998Article ID: Q93035 |
The information in this article applies to:
SUMMARYIn a Microsoft Word dialog box, a selected check box has a value of 1 and a clear check box has a value of 0. To reverse or toggle a check box value, subtract 1 from the current value and use the Abs() function to produce the absolute value of the result. The following example toggles the Background Pagination option in the ToolsOptionsGeneral dialog box:
Sub MAIN
Dim dlg As ToolsOptionsGeneral
GetCurValues dlg
dlg.Pagination = Abs(dlg.Pagination - 1)
ToolsOptionsGeneral dlg
End Sub
In the above example, dlg.Pagination relates to the Pagination parameter
for the ToolsOptionsGeneral macro command:
ToolsOptionsGeneral [.Pagination = number,]The Dim statement is used to declare a dialog box record variable in which the values of a Word dialog box can be stored. The GetCurValues statement stores the current values for the previously dimensioned dialog box in the specified dialog box record. The above example uses "dlg" as the name of the dialog record.
MORE INFORMATIONTo set a value in a Word dialog box, set the dialog box record variable (that is, the dlg.parameter) to 1 or 0:
dlg.SummaryPrompt = 0 'turns option off dlg.SummaryPrompt = 1 'turns option onThe following macro example clears the Prompt For Summary Info check box in the ToolsOptionsSave dialog box:
Sub MAIN
Dim dlg As ToolsOptionsSave
GetCurValues dlg
dlg.SummaryPrompt = 0
ToolsOptionsSave dlg
End Sub
REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, pages 174 and 228.
|
Additional query words: Dim dlg GetCurValues deselect gray out enable
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |