These properties and methods are used to determine which buttons appear in the CyberSecretary dialog, and which button the user has pressed.
This method causes Yes and No buttons to be displayed in the CyberSecretary dialog. Note: if any button is shown, the .Show method will cause the dialog to be displayed until the user presses a button. You can then read the .Button property to see which button was pressed.
.ShowOKOnly
This method causes an OK button to be displayed in the CyberSecretary dialog. Note: if any button is shown, the .Show method will cause the dialog to be displayed until the user presses a button.
This method causes OK and Cancel buttons to be displayed in the CyberSecretary dialog. Note: if any button is shown, the .Show method will cause the dialog to be displayed until the user presses a button. You can then read the .Button property to see which button was pressed.
.Default = CS_YESBUTTON
|CS_NOBUTTON |CS_OKBUTTON |CS_CANCELBUTTON | CS_SNOOZEBUTTON
This property specifies which button is to be the default; that is,
which button is pressed if the user presses {Enter} (or, if no text
box or list box is shown, the spacebar). If this property is not
set, by default the OK button or the Yes button (whichever
is shown) is the default. In the above example, the OK button has
been selected as the default.
As with any good Windows application, you can use the keyboard to select buttons by pressing Alt followed by the underlined letter (mnemonic) on the button. For example, press Alt-O to choose the OK button, Alt-Y to choose the Yes button, Alt-N to choose the No button, or Alt-Z to choose the Snooze button. Press {Esc} to choose the Cancel button.
CyberSecretary goes one step further toward simplicity. As long as no text box or list box is displayed, you can simply press the appropriate letter for the button: O, Y, N, Z or {Esc}.
Setting this property causes a Snooze button to be displayed. Note that, while encountering a script with this directive causes the script to be suspended and re-executed after the specified number of minutes has passed, this feature is not directly supported in a macro. You may, however, check the .Button property to see whether the user has pressed this button; and use a timer to postpone execution of the macro.
.Button = CS_YESBUTTON |CS_NOBUTTON |CS_OKBUTTON |CS_CANCELBUTTON |CS_SNOOZEBUTTON
This property returns the button which was pressed by the user. You will usually want to read this property after the .Show method has been invoked, and use If . . Then or a similar logical structure to take appropriate actions depending on the button which was pressed. For example:
With MySecretary
.Message = "Do you need your calculator, <N>?"
.Icon = "Calculator"
.ShowYesNo
.Show
If .Button = CS_YESBUTTON then
Shell "calc.exe"
.Clear
.Message = "Here's your calculator, <N>!"
.Show
End If
.Hide
End With