CyberSecretary Lite

This page uses frames, but your browser doesn't support them.


Icons And Sounds

Icons and Sounds Reference

The CyberSecretary Object Library includes an extensive library of built-in sounds and icons.

Within a script, the sound and the icon can be selected using the Sound= and Icon= script directives.

Within a macro, select the sound and the icon by setting the .Sound and .Icon properties. Please note, the sound will not be played until the .Show method is invoked. You may also play a sound immediately using the .PlaySound method.

Sounds

The CyberSecretary Object Library includes the following sound and speech effects. Note, all voice effects (other than "sigh") are provided with both male and female voices, and the appropriate voice is automatically chosen depending on the gender of your CyberSecretary.

Show | Default sound when the CyberSecretary dialog is made visible, unless another sound is specified.
Hide | Default sound when the CyberSecretary dialog is closed (hidden).
Click | Default sound when the message in the CyberSecretary dialog is changed, if no user input elements (buttons, list, input box) are visible, unless another sound is specified.
Input | Default sound when the message in the CyberSecretary dialog is changed, if user input elements (buttons, list, input box) are visible, unless another sound is specified.
Error | Default sound when an error occurs.
DoorOpen | An opening door.
DoorShut | A closing door.
Intercom | An intercom buzzer. The default sound when the CyberSecretary tray icon is clicked.
PhoneRing | A ringing telephone.
AlarmBell | An alarm bell.
TouchTones | Telephone touch tones.
Hello | "Hello."
Goodbye | "Goodbye."
GoodMorning | "Good morning."
GoodAfternoon | "Good afternoon."
GoodEvening | "Good evening."
GoodNight | "Good night."
HaveNiceWeekend | "Have a nice weekend!"
Okay | "Okay."
DontForget | "Don't forget!"
Please | "Please?"
ThankYou | "Thank you."
YoureWelcome | "You're welcome."
NewMail | "You have new mail."
TimeForAppt | "It's time for your appointment."
TakeMessage | "Let me take this message for you."
HeresMail | "Here's your mail."
HeresSchedule | "Here's your schedule."
HeresMessages | "Here's your messages."
HeresJournal | "Here's your journal."
HeresTaskList | "Here's your task list."
AddToCalendar | "Let me add this to your calendar."
AddToJournal | "Let me add this to your journal."
CanIFile | "Can I file this for you?"
CanIHelp | "Can I help you with this?"
CanIPrint | "Can I print this for you?"
JustAMoment | "Just a moment..."
IllTakeCare | "I'll take care of that."
WhatWouldYouLike | "What would you like me to do?"
HereYouAre | "Here you are."
Sigh |
AtMyDesk | "I'll be at my desk."
Uh-Oh | "Uh-oh!"

Icons

The CyberSecretary Object Library includes over 150 built-in icons:


CyberSecretary Lite - Calendar

Your Calendar Your CyberSecretary will bring you your Outlook 2000 calendar at the start of the day, so you can see the day’s appointments at a glance. |
 | Your CyberSecretary will also come and remind you – in her own voice – when it is time for an appointment – instead of the default reminder built in to Microsoft Outlook. Let your CyberSecretary put the “face” – and the voice! – in “user interface”!


CyberSecretary Lite - Contacts

Your Contacts

Your CyberSecretary will also come whenever you open a contact in Microsoft Outlook 2000, and will offer to take down a phone message, log a phone call, or create an electronic mail message addressed to the contact.

What’s more, if you have an Internet connection, your CyberSecretary will also offer to get a street map showing where your contact is located. Street maps and driving directions are provided by MapBlast.

The date and time of Phone Messages are recorded in the “Callback” field for Outlook contacts. You will want to add this column to a Contact List view. You may also filter the view (so that only your call list is displayed), or automatically format the view (so that your calls to make are highlighted). See Microsoft Outlook documentation for information on how to modify your Contact List view.


CyberSecretary Lite

For Microsoft Outlook 2000


CyberSecretary Lite - Inbox

Your Incoming Mail Your CyberSecretary will bring you your Outlook 2000 Inbox at the start of the day. |
 | Whenever you receive new mail, your CyberSecretary will come and announce its arrival, in her own voice, and will offer to open the message for you.


CyberSecretary Lite - Internet

Click Her Icon . . .

and your CyberSecretary will come right away … because there are still more things that she can do for you!

If you have an Internet connection, your CyberSecretary can get stock prices for you. The first time, you will be asked for the stock name and ticker symbol that you want to track. Your CyberSecretary will do this automatically three times during the trading day, and again after the markets close. Or, right-click to get the latest stock price on demand! Stock prices are provided courtesy of Yahoo!

If you have an Internet connection, you can launch an Internet search without opening your browser first – using most of the popular Internet search engines.


CyberSecretary Lite

CyberSecretary, the world's first Virtual Office Assistant, is now available in a Lite version, specially designed for users of Microsoft Outlook 2000.

CyberSecretary Lite is designed to perform the most useful tasks for Outlook 2000 users. CyberSecretary Lite is also easy to use: just copy the program files to the folder of your choice and run CSLITE.EXE. Your CyberSecretary will come and do the rest!

Your CyberSecretary can do the following:

  • Show you your calendar and remind you of upcoming appointments.
  • Take down phone messages, log phone calls – even get street maps via the Internet.
  • Announce new mail messages.
  • Print and file sent mail messages; log sent mail messages in your journal; and set reminders for following up.
  • Notifying you when it is time to follow up on a mail message.
  • Getting stock quotations via the Internet, and performing Internet searches.
  • Reminding you of important tasks (once, daily or weekly).
  • more!


CyberSecretary Lite - Macros

Your Macros . . .

will never be the same with your CyberSecretary! CyberSecretary Lite is built using the CyberSecretary Object Library, an ActiveX component which can be used in any Word, Excel or other macro written using Microsoft Visual Basic for Applications. The CyberSecretary Object Library offers the following features:

  • A common user interface using the Virtual Office Assistant!

  • A library of over 45 sound and speech clips, over 150 icons, and various facial expressions both male and female!

  • An easy to use, flexible dialog box that includes messages for the user, text input by the user, buttons, a drop-down list box – even a progress indicator!

  • The ability to access many Windows functions (reading/writing the Registry and .INI files, opening and printing document files, accessing common dialog boxes, even accessing files via the Internet!

Adding CyberSecretary to your VBA macros is a simple process:

  1. If desired, record keystrokes and mouse clicks using the macro recorder in the desired application.
  2. Open the macro in the Visual Basic editor by pressing Alt-F11.
  3. Use the DIM keyword to create an object variable which will refer to your CyberSecretary.
  4. Use the CreateObject function (or the SET function with the NEW keyword) to create the CyberSecretary.
  5. Set your CyberSecretary's properties (to specify screen position, a caption, message, icon, sound effect, and facial expression, to specify whether the dialog will include a space for user input or a drop-down list, and to specify which buttons will appear).
  6. Use the SHOW method to display the dialog.
  7. Read your CyberSecretary's properties (e.g. which button was pushed, what text was entered, what was selected from the list) and process accordingly.

Press Here for more details on how you can use the CyberSecretary Object Library in your own macros!


CyberSecretary Lite - Macros

This page uses frames, but your browser doesn't support them.


Adding CyberSecretary to a Macro

It's very simple to add CyberSecretary to your own Visual Basic macro projects, following these directions:

Step 1. Record a basic macro.

While you can write a CyberSecretary-enhanced macro from scratch, probably the easiest way to begin is to record a macro using the Word or Excel macro recorder. This enables you to specify a hotkey or toolbar button for accessing the macro, lets you specify a template as a container for the macro, and lets you record those steps which are recordable.

Step 2. Open the macro in the Visual Basic editor.

Press {Alt-F11} to access the Visual Basic editor. In the Project list on the left side of the window, select the template containing the macro. The code for the macro will probably be found under Modules | NewMacros. Now, click anywhere in the Code window and scroll down until you find the macro which you recorded. It will appear as a subroutine bearing the name you assigned to the macro.

Step 3. Add a reference to the CyberSecretary object library.

Select Tools | References on the menu. This will display a list of external ActiveX files that can be accessed by your macros. If CYBERSEC.DLL has been installed on your computer, you will see an entry for the CyberSecretary Object Library. Make sure this is checked. If this entry isn't visible, click the Browse button and find CYBERSEC.DLL. This step will make the CyberSecretary Object Library available for your programs.

Step 4. Initialize your CyberSecretary.

This is done by declaring variables of the type CSAgency and CSDialog, initializing the CSAgency variable using the New keyword, and then using this variable to initialize and return the CSDialog variable. If you understand object oriented programming this will already make sense; but if this is unfamiliar, just copy the following five lines of code to the beginning of your macro's code:

    Dim MyAgency as CSAgency
    Dim MySecretary as CSDialog
    Set MyAgency = New CSAgency
    Set MySecretary = MyAgency.GetCyberSecretary(Application. _
        VBE.ActiveVBProject, 0, 0)
    Set MyAgency = Nothing
In the above code, the first two lines declare the necessary object variables. The third line actually creates the CSAgency object and assigns it to the MyAgency variable. This variable is used solely to create the CSDialog object (your CyberSecretary!), which will be used for most of the "action." At this point, MyAgency is no longer used, and so it is cleared (and the memory freed) by the fifth line.

Note that if you've already used your CyberSecretary, then your personal information (e.g. your CyberSecretary's name, gender, how you'd like to be addressed, etc.) are automatically initialized.

Step 5. Use properties and methods to define the CyberSecretary Dialog.

CyberSecretary is an ActiveX object. What this means is that he or she is controlled by setting his or her properties (such as the dialog message, icon, sound effect), reading his or her properties (such as the text entered by the user at run-time, the item chosen from a list, or the button that was pressed), and invoking his or her methods (such as opening a document or getting a file from the Internet). If you're already familiar with object-oriented programming, this will be second nature. If you're not, then working with your CyberSecretary is an excellent and simple way to learn!

Properties essentially describe the CyberSecretary – his or her appearance and content. Methods are actions that can be performed by your CyberSecretary. (If this doesn't make complete sense, just think of properties as adjectives and methods as verbs.)

Once you've initialized your CyberSecretary, properties are set or read and methods are invoked by specifying the name of your CyberSecretary object variable, followed by a period, followed by the name of the property or method. For example, the following code gives the CyberSecretary a sad expression:

      MySecretary.Picture = CS_SAD
You set a property by specifying the property, followed by an equal sign, followed by the desired value for that property (which, depending on the property, will either be a string literal or variable; an integer; True or False, or one of an enumerated list of options. Here's an example of setting a property to an enumerated list: namely, one of the more than 150 icons built into the CyberSecretary Object Library. If you start to enter the following code in the Visual Basic editor, you will be presented with a scrollable drop-down list showing the possible choices.

You read a property by specifying a variable of the appropriate type, followed by an equal sign, followed by the desired CyberSecretary property; e.g.
      SearchSite$ = MySecretary.ListSelection
You invoke a method by specifying the desired method, and including any necessary parameters for that method. Some CyberSecretary methods (e.g. .Show and .ShowYesNo) do not require parameters; other methods (e.g. .Position) require parameters.

Note that the Visual Basic editor will automatically present you with a list of recognized properties and methods; and, as shown above, valid values for certain items (e.g. the .Picture, .Icon, .Gender and .Sound properties), making it easy as pie to write error-free macro code.

Usually you will be setting more than one property at a time, or invoking more than one method. To save keystrokes and make your code more readable, use the With keyword:

With MySecretary
    .Gender = CS_FEMALE
    .Picture = CS_SMILE
    .Icon = ICO_EARTH
    .Message = "Please pick a search engine and let me" _
        + "know what you want me to look for, <N>."
    .InputLines = 1
    .List = "Infoseek|Altavista|Lycos|Excite!|Yahoo"
    .ShowOKCancel
    .Show
End With
This code would produce the following dialog:

In this example, the first seven lines of code between With and End With set six properties (.Gender, .Picture, .Icon, .Message, .InputLines and .List) and invoke one method (.ShowOKCancel) to set up the contents of the dialog. This is followed by the .Show method, which displays the dialog and waits for user input.

Step 6. Invoke the Show method to display the dialog.

In the above example, the first seven lines of the With structure set the visual elements of the CyberSecretary dialog: the gender, the picture, the icon, the message, the text input line, the drop-down list and the buttons. The dialog is not displayed, however, until you invoke the .Show method. The .Show method causes the CyberSecretary dialog to be displayed with the most recently defined parameters. Note that if the dialog includes any elements requiring user input (buttons, list or text box), the dialog will remain displayed until the user presses a button. If the dialog does not include any elements requiring user input (i.e. if it is just displaying a message), the dialog will remain displayed for the length of time specified by the .Wait property (default 3 seconds). Please note, while code execution continues when the .Wait time has passed or the user has pressed a button, the dialog will not disappear until macro execution ceases or you invoke the .Hide method.

Step 7. Determine the user's response.

Subsequent code would determine which button the user pressed, and would extract the information from the text box and the drop-down list box:

With MySecretary
    If .Button = CS_OKBUTTON then
        sSearchSite = .ListSelection
        sSearchData = .UserInput
        'Insert code here if OK was pressed
    End If
    .Hide
End With

Your macro can then use this information for further execution. This may include using some of the other useful methods provided by your CyberSecretary, avoiding the need for Windows API calls.

MySecretary.SearchInternet sSearchSite,
    sSearchData
sData = MySecretary.GetURL "my.yahoo.com"
Open "c:\Temp\Yahoo.htm" for Output as #1
Print #1, sData
Close #1
MySecretary.PrintFile "c:\Temp\Yahoo.htm"
Kill "c:\Temp\Yahoo.htm"

Step 8. Clean up.

Before your macro exits, be sure to hide your CyberSecretary, and clear your CyberSecretary and any other object variables. Otherwise, CYBERSEC.DLL will remain in memory even after your macro is finished.
      MySecretary.Hide
      Set MySecretary = Nothing
      Exit Sub


Properties And Methods: Buttons And Commands

These properties and methods are used to determine which buttons appear in the CyberSecretary dialog, and which button the user has pressed.

.ShowYesNo

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.

.ShowOKCancel

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}.

.Snooze = minutes

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


Properties And Methods: CyberSecretary Dialog

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:

    <N>

    The name (preferred form of address) of the user (e.g. "John", "Mr. Smith", "sir"):

      Message=Shall I print this report, <N>?

    <F>, <G>, <L>

    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
    mmm
    mm
    m

            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
    Month abbreviated, e.g. Sep.
    Month numeral with leading zeros, e.g. 09
    Month numeral without leading zeros, e.g. 9

    <Date|m/d/yy>

    The current date in short format, e.g. 9/1/97.

    <Time|h:mm ampm>

    The current time.

.Caption = "Caption"

This property sets the caption that is displayed in the CyberSecretary dialog. The caption will be preceded by your CyberSecretary's name.

.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.


Properties And Methods: Working With Files

The CyberSecretary Object Library includes a number of built-in methods for working with files, to perform tasks which would otherwise require Windows API calls.

.PickFile "EXT", "FilePath", CS_OPEN |CS_SAVE

This function displays a Windows 95/98 common dialog (Open or Save As) which can be used to select a file name, and returns the file name selected by the user. You may specify the default extension and file filter, as well as the default path.

sFileName = MySecretary.GetFileName "TXT", "c:\Windows", CS_OPEN

.PickFolder "DefaultPath"

This function displays a list of drives and folders in the CyberSecretary dialog box, and allows the user to select any existing folder, which is returned as a string value. Please note that you should set the CyberSecretary message and icon before invoking this function.

.OpenFile "Filename"

This method opens the specified file using the application associated with the file type (for example, an .XLS file will be opened in Microsoft Exccel). This is the same as right-clicking on the specified file and choosing Open.

.PrintFile "Filename"

This method prints the specified file using the application associated with the file type (for example, an .XLS file will be printed using Microsoft Excel). This is the same result as right-clicking on the specified file and choosing Print.

.EditFile "Filename"

This method opens the specified file for editing. It is the same as right-clicking on the file and choosing Edit. It is most useful for types of files that have separate actions defined for editing and opening, e.g. Registry files (.REG) and MS-DOS batch files (.BAT).

.ViewFile "Filename"

This method causes a file to be displayed using a viewer specified in the Registry. By default, text files are viewed using WordPad, and binary files (including rich text and HTML files) are viewed using QuickView. You can, however, change these settings by editing the Binary Viewer and Text Viewer values under the Registry key HKEY_CURRENT_USER\ Software\ VB and VBA Program Settings\ CyberSecretary\General


CyberSecretary Lite

CyberSecretary Object Library

Adding the power of CyberSecretary to your macros!


Properties And Methods: Internet Commands

CyberSecretary for Microsoft Outlook includes several functions which are useful for accessing information via the Internet.

.SearchInternet "Engine", "Query"

This method initiates an Internet search for the specified query using the chosen search engine. The query string for the chosen search engine is stored in the Registry under HKEY_CURRENT_USER\ Software\ VB and VBA Program Settings\ CyberSecretary\ Internet. Several popular search engines are added to the Registry by CyberSecretary's setup program, and others can be added. The search results are displayed using the default web browser. This way of making searches is faster than loading the search engine's home page.

.GetURL "URL"

This method returns the data identified by the specified URL and returns it as a variant. Usually this would be a web page, but may be any type of data. This method is useful for obtaining a web page and returning it to be pasted into a Word document or Outlook mail message. For example, the following code will post your "My Yahoo!" page to your Outlook Inbox:

    Dim ol as Outlook.Application
    Set ol = New Outlook.Application
    Dim MyPost as PostItem
    Set MyPost = ol.CreateItem(olPostItem)
    MyPost.HTMLBody = MySecretary.GetURL "http://my.yahoo.com"
    MyPost.Post

.GetFileFTP "Site", "RemoteFile", "LocalFile"

This method uses Internet FTP to download the specified remote file from the specified site, saving it as the specified local file. Please note, this method only works with anonymous FTP. Logins requiring passwords are not supported at this time.

.GetMap "Street", "City", "State", "PostalCode"

This method uses the MapBlast Internet mapping service to display a street map in the user's default web browser. The four parameters can be input by the user or might be extracted from an Outlook contact item, e.g.:

    Dim MyContact as ContactItem
    Set MyContact = ol.ActiveInspector.CurrentItem
    With MyContact
        MySecretary.GetMap .BusinessAddressStreet, _
            .BusinessAddressCity, .BusinessAddressState, _
            .BusinessAddressPostalCode
    End With

.GetStockPrice "Ticker Name"

This method uses the Yahoo! Internet stock quote service to access current stock quotations. This method requires a single string parameter consisting of the stock ticker symbol followed by a space and the name of the stock. The current price and today's price change are returned by your CyberSecretary's dialog box – with appropriate facial expressions depending on whether the stock price is up, down or unchanged. You will then be given the option whether to obtain a full stock report in your web browser.


Using CyberSecretary In Macros

You can use your CyberSecretary in your Microsoft Word, Excel or other macros written using Microsoft's Visual Basic for Applications. This offers the following useful features:

  • Give messages to the user, either for a fixed time or until a button is pressed.
  • Get input from the user, including input text, list selections, and button presses.
  • Perform useful commands and functions that would otherwise require programming the Windows API, such as getting information from the Internet, opening document files, etc.
All this is done using the familiar CyberSecretary user interface, which includes:
  • A library of visual expressions, icons, and sound effects.
  • A flexible, easy to manage dialog box, which includes a message balloon, buttons, a drop-down list, space for user input, even a progress bar.
These functions are not only more easily performed by using the CyberSecretary Object Library, but are performed using the common, consistent and friendly user interface of your own personal CyberSecretary.


Properties And Methods: Miscellaneous

The CyberSecretary Object Library also includes methods and functions for easily reading and writing .INI files and Registry settings, avoiding the need to use Windows API calls.

.ReadINIFile "File", "Section", " Key"

This function is used to read values from Windows .INI files.

.WriteINIFile "File", "Section", "Key", "Value"

This method is used to write values to Windows .INI files.

.GetRegistryValue HKey, "Key", "Value"

This function is used to read settings from the Windows Registry. Please note that presently only string values are supported.

.SetRegistryValue HKey, "Key", "Value", "Data"

This method is used to save settings to the Windows Registry. Please note that presently only string values are supported.

.PlayGame "DataFile"

Your CyberSecretary would not be complete without a method "just for fun," to demonstrate your CyberSecretary's built-in artificial intelligence capabilities! The .PlayGame method is a built-in guessing game in which you think of a person, place, or thing, and your CyberSecretary tries to guess the answer using Yes/No questions. If your CyberSecretary does not guess correctly, your CyberSecretary will ask you to provide a question which he or she can use to distinguish his or her guess from the person, place or thing that you were thinking of. Your CyberSecretary "remembers" this information and gets better with practice!

The parameter is a specially formatted game data file. Usually this will be a text file with the .INI extension. A game data file will begin with only one question and two guesses. Here's an example.

[General]

Nouns=Common

Subject=animal

[Questions]

Number=3

1=Does it swim?

2=Is it a shark?

3=Is it a tiger?

[Yes]

1=2

[No]

1=3

Note the following:

  • The "Nouns" parameter should be Common for things; Proper for persons or places.
  • The "Subject" parameter should be a brief description of what is being guessed, in the singular; e.g. animal, president, European city, state capital, etc.
  • A game file should initially begin with three questions, consisting of one yes/no question and two guesses.
  • The [Yes] section should begin with the guess to be made if the first question is answered Yes. The [No] section should begin with the guess to be made if the first question is answered No. Over time, as the game is played, your CyberSecretary will store his or her growing knowledge of the subject matter here. Ordinarily, you will never need to edit a game file once it has been created and used for the first time.


Properties And Methods: User Input

The CyberSecretary Object Library includes properties for getting user input – either free-form text input, or an item selected from a drop-down list.

Selecting Items From A List

.List = "Item1|Item2|Item3|...|ItemN"

Setting this property causes a drop-down list box to appear, displaying the items shown in the list. The items shown in the list should be separated by vertical bars. Set the .ListSelection property to specify which item in the list is initially displayed; by default this is the first item in the list. Read the .ListSelection property to determine which item was selected by the user. Set this property to an empty string (e.g. .List = ""), or invoke the .Clear method, to make the list box disappear.

.ListSelection

Setting this property controls which item in a list is displayed as the default. If this property is not set, the first item in the list is shown. Read this property to determine which item in the list was selected by the user. You can then use a Select Case or other appropriate logical structure for taking appropriate actions depending on what item was selected by the user. For example:

With MySecretary
    .Icon = "Earth"
    .Message = "Which Internet site would you like" _
        + "to visit, <N>?"
    .List = "Yahoo!|Slipstick|Altavista"
    .ShowOKCancel
    .Show
    If .Button = CS_OKBUTTON then
        Select Case .ListSelection
        Case "Yahoo!"
            .OpenFile "http://my.yahoo.com"
        Case "Slipstick"
            .OpenFile "http://www.slipstick.com"
        Case "Altavista"
            .OpenFile "http://altavista.digital.com"
        End Select
    End If
End With

.RemoveListSelection

This method removes the currently selected item from the drop-down list. This will usually be the item selected by the user, but can be set in code using the .ListSelection method. This method is mainly useful for macros that call for repeated processing of the same list, where it is necessary or desirable to avoid repeated selection of the same list item.

Getting Text Input

.InputLines = Lines

Setting this property causes a free-form text input box to appear. The size of the free-form text input box is specified by the Lines parameter, and can range from a single line, to as many lines as will fit on your screen. You can enter default text to be displayed by setting the .UserInput property. Read the .UserInput property to determine what text was entered by the user. Set .InputLines = 0 (or invoke the .Clear method) to remove the text box.

.UserInput

Setting this property sets the default text which will appear in the text box created using the .InputLines property. Read this property to obtain the text entered by the user and then assign it to a variable (string or variant).


CyberSecretary Lite

Customize Your CyberSecretary!

You can choose which of these tasks you’d like your CyberSecretary to perform. Just right-click on her tray icon, choose “Customize Me,” and you will be presented with the dialog at the left. Simply choose which of these tasks you’d like her to perform.

If you’d like, your CyberSecretary can appear as an icon when new messages arrive, when you open a contact, or when mail is sent. Click on the icon (or press ENTER) and your CyberSecretary’s full dialog will appear. Wait five seconds (or press ESC) and the icon will disappear.

If you want more options for customizing your CyberSecretary, try the full version of CyberSecretary 2000! The full version features unlimited control of your CyberSecretary’s appearance and actions through scripts!

Let’s Play!

And what assistant – human or virtual – would be complete, without the ability to play a game? Your CyberSecretary comes with three of them: choose a place, a president, or an animal, and she will try to guess. She gets better with practice!

CyberSecretary Lite requires the Microsoft Visual Basic 6 runtime library, and Microsoft Outlook 2000.

For more information, please visit our web site:

http://users.erols.com/wheindl/cybersecretary

Or send email to: Walter E. Heindl

CyberSecretary is Copyright © 1997-2000 by Walter E. Heindl.


CyberSecretary Lite - Reminders

Don’t Forget . . . Your CyberSecretary won’t let you forget those important tasks. If you’d like your CyberSecretary to remind you of something – either today, tomorrow, every day, or every week – just left-click her tray icon to set a reminder. | When the reminder comes due, your CyberSecretary will come to tell you. You can choose to cancel the reminder, or to be reminded again if you’re not ready.
Following Up Mail . . . is easy with your CyberSecretary! Whenever you send a message, you’ll be given an opportunity to set a follow-up reminder. Your CyberSecretary will automatically remind you when it is time to follow up. | If you choose to follow up on your messages, your CyberSecretary will open each message that is due, and give you the choice of cancelling the reminder, sending a follow-up message, or setting a new follow-up reminder.


CyberSecretary Lite - Sent Mail

Your Sent Mail

Your CyberSecretary can perform many useful tasks with your sent mail – and will automatically come and offer to do them whenever you send a message!

Your CyberSecretary will offer to print messages. If you answer “yes,” you can choose to add an additional line to the header, showing the paper file where the printed message should be filed.

Your CyberSecretary will offer to save messages – either chronologically (by month and year) in your Outlook personal folders, or in the Outlook folder that you choose. You can even choose to save messages as files (.DOC, .RTF, .TXT, or .MSG) chronologically (by month and year) on your hard drive, so that you can keep your Outlook personal folders lean!

Your CyberSecretary will offer to set a follow-up reminder for messages – from one day to one year. What’s more, when the follow-up comes due, your CyberSecretary will automatically offer to create a follow-up message, set a new reminder, or cancel the reminder! Messages with follow-ups are moved to a “Diary” folder which your CyberSecretary creates, and the follow-up date and time is stored in the “Flag Due By” field. You may want to add this folder to your Outlook bar, and add this field to the Outlook view, so you can see all your follow-ups at a glance. See the Microsoft Outlook 2000 documentation for more details on how to do this.

Your CyberSecretary will also offer to create journal entries for sent messages. This journal entry will contain your notes, and also a link to the message (or file, if you chose to save the message as a file).


Properties And Methods: Buttons And Commands

Dialog Box Buttons

These properties and methods are used to determine which buttons appear in the CyberSecretary dialog, and which button the user has pressed.

.ShowYesNo

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.

.ShowOKCancel

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}.

.Snooze = minutes

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


Properties And Methods: CyberSecretary Dialog

The CyberSecretary Dialog

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:

    <N>

    The name (preferred form of address) of the user (e.g. "John", "Mr. Smith", "sir"):

      Message=Shall I print this report, <N>?

    <F>, <G>, <L>

    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
    mmm
    mm
    m

            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
    Month abbreviated, e.g. Sep.
    Month numeral with leading zeros, e.g. 09
    Month numeral without leading zeros, e.g. 9

    <Date|m/d/yy>

    The current date in short format, e.g. 9/1/97.

    <Time|h:mm ampm>

    The current time.

.Caption = "Caption"

This property sets the caption that is displayed in the CyberSecretary dialog. The caption will be preceded by your CyberSecretary's name.

.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.


Properties And Methods: User Input

Getting User Input

The CyberSecretary Object Library includes properties for getting user input – either free-form text input, or an item selected from a drop-down list.

Selecting Items From A List

.List = "Item1|Item2|Item3|...|ItemN"

Setting this property causes a drop-down list box to appear, displaying the items shown in the list. The items shown in the list should be separated by vertical bars. Set the .ListSelection property to specify which item in the list is initially displayed; by default this is the first item in the list. Read the .ListSelection property to determine which item was selected by the user. Set this property to an empty string (e.g. .List = ""), or invoke the .Clear method, to make the list box disappear.

.ListSelection

Setting this property controls which item in a list is displayed as the default. If this property is not set, the first item in the list is shown. Read this property to determine which item in the list was selected by the user. You can then use a Select Case or other appropriate logical structure for taking appropriate actions depending on what item was selected by the user. For example:

With MySecretary
    .Icon = "Earth"
    .Message = "Which Internet site would you like" _
        + "to visit, <N>?"
    .List = "Yahoo!|Slipstick|Altavista"
    .ShowOKCancel
    .Show
    If .Button = CS_OKBUTTON then
        Select Case .ListSelection
        Case "Yahoo!"
            .OpenFile "http://my.yahoo.com"
        Case "Slipstick"
            .OpenFile "http://www.slipstick.com"
        Case "Altavista"
            .OpenFile "http://altavista.digital.com"
        End Select
    End If
End With

.RemoveListSelection

This method removes the currently selected item from the drop-down list. This will usually be the item selected by the user, but can be set in code using the .ListSelection method. This method is mainly useful for macros that call for repeated processing of the same list, where it is necessary or desirable to avoid repeated selection of the same list item.

Getting Text Input

.InputLines = Lines

Setting this property causes a free-form text input box to appear. The size of the free-form text input box is specified by the Lines parameter, and can range from a single line, to as many lines as will fit on your screen. You can enter default text to be displayed by setting the .UserInput property. Read the .UserInput property to determine what text was entered by the user. Set .InputLines = 0 (or invoke the .Clear method) to remove the text box.

.UserInput

Setting this property sets the default text which will appear in the text box created using the .InputLines property. Read this property to obtain the text entered by the user and then assign it to a variable (string or variant).