The following properties and methods control the appearance of the CyberSecretary dialog:
.Message = "Message"
The .Message property is used to specify the message which is to appear inside your CyberSecretary's "speech balloon." Normally there is space for about six lines of text. However, please note that if more text is specified than will fit, the balloon automatically expands to cover it.
You may display longer messages (more than about 200 characters; up to what will fit on the screen) simply by specifying the name of a text file as this parameter. This will cause the program to read the contents of the text file and display it as a message.
In either case, the specified message may include the following variables, which must be enclosed in angle brackets, and which are case sensitive. These angle brackets will automatically be replaced with the specified information, as follows:
The name (preferred form of address) of the user (e.g. "John", "Mr. Smith", "sir"):
Message=Shall I print this report, <N>?
The full name of the user; the given (first) name of the user; and the last name of the user.
<MyName>
The CyberSecretaryÆs first name.
<Date|mmmm d, yyyy>
The current date in long format, e.g. September 1, 1999. The format
can be customized:
dddd
ddd dd d mmmm
|
Day of the week, e.g. Monday
Day of the week, abbreviated, e.g. Mon. Date of month with leading zeros, e.g. 01 Date of month without leading zeros, e.g. 1 Month, e.g. September
|
The current date in short format, e.g. 9/1/97.
<Time|h:mm ampm>
The current time.
.Gender = CS_MALE|CS_FEMALE|CS_DEFAULTGENDER|CS_NODEFAULTGENDER
This property sets the gender of the CyberSecretary. If this
property is not set, the default gender (chosen at the time CyberSecretary
was first installed) will be read from the Registry.
.Picture = CS_SMILE|CS_LAUGH|CS_ANGRY|CS_SAD|CS_STRAIGHT|CS_TALK
This property sets the facial expression of the CyberSecretary.
If this property is not set, CS_SMILE will be used as the default.
.Icon =
ICO_xxxx
This property determines the icon that is displayed in the CyberSecretary
dialog. More than 150 icons are available, and will appear in a
scrollable, drop-down list in the Visual Basic editor when you set this
property. Press here to see
all of the available icons.
.Sound = SND_xxxx
This property specifies a sound effect to be played when the .Show
method is invoked. CyberSecretary comes with a library of a dozen sound effects,
plus over 30 useful voice
clips. These will appear in a scrollable, drop-down list
in the Visual Basic editor when you set this property. Press
here to see all of the available sound and speech effects.
Note: You do not need to specify a sound. If you do not specify a sound, CyberSecretary automatically uses a set of predefined sound effects.
.PlaySound SND_xxxx
This method (note: there is no equal sign) is similar to setting the .Sound property, with one important difference. If you set the sound effect using the .Sound property, the sound will not be played until the .Show method is invoked. The .PlaySound method will play the sound immediately, without waiting for the .Show method to be invoked. As with the .Sound property, the .PlaySound method will present you with a scrollable, drop-down listing of available sound and speech effects.
.Position XPos, YPos
This method (note: there is no equal sign) controls the horizontal
and vertical position of the CyberSecretary dialog on the screen.
The range is from 0 to 100, with 0 being the left or top edge of the screen,
100 being the right or bottom edge of the screen, and 50 being centered
(the default). For example, .Position 0, 0 moves the dialog
to the upper left corner; .Position 100, 0 moves the dialog to the
upper right corner, .Position 0, 100 moves the dialog to the lower
left corner, and .Position 100, 100 moves the dialog to the lower
right corner.
.Wait = Seconds
This property controls how long the CyberSecretary dialog is displayed.
It is only effective if no button, list or text box is displayed, i.e.
the CyberSecretary is merely displaying a message. The default is
3 seconds. Use this command to specify a longer or shorter display
time.
.Clear
This method removes all buttons, the text box and the drop-down list box, clears the message text, and clears the contents of the drop-down list and text boxes. It does not affect the icon, picture or screen position. Usually this method will be used to clear buttons from the dialog so that the results can be displayed as a message for a specified time. Please note, if you invoke this method after obtaining user input or a list selection from the user, be sure to read the .UserInput or .ListSelection properties before invoking the .Clear method, as otherwise that data will be lost.
.Name = "Name"
Setting this property changes the name of the CyberSecretary. Reading this property returns the name of the CyberSecretary. Note: if you do not set this property, the CyberSecretary's name will automatically be read from the Registry.
.Progress = x
This property is used to display a variable progress indicator in the CyberSecretary dialog. Set x to the desired progress value, which may range from 0 to 100. Set x to -1 to cause the progress indicator to disappear. Setting x to other negative values will change the color of the progress bar from the default blue. Note that the progress bar cannot be displayed if any buttons are displayed; setting .Progress to any value from 0 to 100 will cause any buttons on the dialog to disappear.
.Show
This method should be invoked once the contents and position of the CyberSecretary dialog has been defined, and causes the dialog to be displayed. Note that if the CyberSecretary dialog includes any elements which require user input (list box, text box or buttons), the dialog will remain open and code execution will pause until the user presses a button. If the CyberSecretary dialog includes no elements requiring user input (i.e. if it is displaying a message only), the dialog will remain open and code execution will pause for the time specified by the .Wait property. Please note that while code execution resumes at the end of the wait period or when a button has been pressed, the dialog will not disappear until you invoke the .Hide method, or macro execution terminates.
.Hide
This method causes the CyberSecretary dialog to be closed (hidden). Normally you will want to invoke the .Hide method when all user input has been obtained and all status messages have been given to the user. In any case, you should invoke this method to close the CyberSecretary before your macro execution terminates. Do not forget to set your object variables to Nothing so that the memory used by your CyberSecretary dialog is freed.
MySecretary.Hide Set MySecretary = Nothing End Sub
.QuickSet Icon, Picture, Sound, Buttons, Wait, InputLines, "Caption", "Message", "List"
This method provides a fast and simple means of specifying an icon, picture, sound, button combination, caption, message, etc. and displaying the resulting dialog. This allows a dialog to be specified and shown with a single line of code, rather than as many as seven or eight lines of code. Note that the .Show method is automatically invoked, and does not need to be explicitly invoked, if this method is invoked.