How can I obtain the free/busy times of offline users?
Several frustrated administrators have told me that when they try to schedule appointments, they can't be certain that the free/busy times on the Attendee Availability page of the meeting request are accurate. For example, if someone receives several meeting invitations but is taking a few days off, by the time that person returns to work and responds to the invitations, conflicts are likely to occur. And if five people try to schedule a meeting with the boss at the same time—but the boss is out of town and not checking the Calendar folder—each person has no way of knowing that the other four also want to book the same time.
These frustrated administrators would like to have meeting requests appear immediately in the user's free/busy times but marked as tentative until the user can respond. Delegates and direct booking are two ways to accomplish tentative booking. (For more information about delegates, see "Outlook Tips and Techniques," May 1998.)
A delegate could book all incoming appointments as tentative as soon as someone proposes them. Or if such busy people are willing to grant direct access to their calendars, you can make tentative bookings without going through a delegate. You can grant access to your calendar by going to the Permissions tab of the File, Folders, Properties page for the Calendar folder.
Another possibility is to adapt the AutoAccept script you use to book resources such as conference rooms. (You can obtain Robert Strong's AutoAccept script from the Code Samples at http://www.exchangecode.com.) You can modify the script to accept all nonconflicting appointments but mark them tentative. You'll probably want to leave the meeting requests in the Inbox for the user to review during his or her next Outlook session.
Outlook 2000 users can obtain a free COM add-in that synchronizes free/ busy times for offline users. For more information, see http://www. slipstick.com/ addins/gallery/ offlinefb.htm.
Can I use a script debugger with Exchange Server Event Service scripts?
Both Outlook 98 and Outlook 2000 include tools for debugging any type of VBScript code, but typical installations don't include these components. To install the script debugger from Outlook 98,
- Go to Control Panel, and run Add/Remove Programs.
- From the Install/Uninstall list, select Microsoft Outlook 98, and then click Add/Remove.
- In the first screen of the Maintenance Wizard, click Add New Components. (If Outlook asks you whether to install the component from a CD-ROM or the Web, choose whichever is appropriate for your installation.)
- After the Microsoft Outlook 98 Component Install page loads and analyzes your system, check the box for Development Tools under Microsoft Outlook 98, and then click Next.
- On the next Web page that appears, click Install Now.
For Outlook 2000, the script debugger is part of the Web Scripting component. Run any Outlook form that includes VBScript code, and then choose Tools, Forms, Script Debugger. If you haven't installed Web Scripting yet, Outlook will prompt you for your Office or Outlook CD-ROM or network installation share path.
For Event Service scripts on Exchange Server folders, the script debugger doesn't run when a runtime error occurs in a script. Instead, you must add a Stop statement to the code where you want debugging to begin. When the script reaches the Stop statement, the debugger loads. You can then continue execution step by step, check variable values, or perform other debugging chores.
How can I make voting buttons more flexible?
Voting buttons are one of my favorite Outlook features. My May 1998 column introduced the basics of voting buttons. Because more people use voting buttons now, let's look at possible enhancements.
Voting buttons are a subset of custom actions; you create these actions on the (Actions) tab of a form in design mode. When you use the View, Options dialog on a message to create voting buttons, Outlook automatically creates the corresponding custom actions. For example, the message in Screen 1 shows voting buttons you create to poll the staff about their choice of pizza for Friday's delivery. In Screen 2, you see the custom actions that correspond to those voting buttons.
You can associate code with each custom action. In the code window of a Message form opened in design mode, choose Script, Event Handler, and then select CustomAction to add the shell of an Item_CustomAction() function to your code. You'll need to add a Select Case ... End Select block, as Listing 1 shows, with a Case statement for the name of each voting button.
The one drawback to adding code to a voting button form is that unless you publish the form, users will get the Disable Macros/Enable Macros message when they open the form. Therefore, you probably want to reserve code on voting button forms for those occasions when you're building a form to publish to the Organization Forms Library for frequent use.
How can I configure a voting button to let users enter their own text?
You can't always have a voting button for every possible answer. For example, the pizza shop offers many varieties, and some people want smoked chicken or other exotic flavors. By adding a new voting button named Other with a little code to go with it, you can prompt the users for their choices and still have the information reported back to the sender and recorded on the original message's Tracking tab.
Use View, Options to add an Other voting button, then open the form in design mode and switch to the (Actions) tab. In the Action name column, double-click Other to display the Form Action Properties dialog in Screen 3. Under This action will, select Send the form immediately. This choice suppresses the pop-up window that asks the respondent to either send the form immediately or edit it first. Because you're asking about the pizza variety in a separate pop-up window, you don't need any other response in the body of the message.
Next, add the code in Listing 2 to the form. The
statement creates code for the Other action. The
function gets the user's choice. The code
NewItem.VotingResponse = strChoice
adds the user's choice to the outgoing response item.
As you see in Screen 4, when the sender of the original voting button message processes the response, Outlook correctly records the respondent's choice on the Tracking tab, just as if you'd offered a voting button for Smoked Chicken.
How do I get Outlook 98 to use the Courier New font instead of Arial to print the body of messages received in Plain Text format?
Oddly, Outlook 98 lets you set the display font for Plain Text messages—Courier New is the default—but doesn't use that font for printing. Instead, it always insists on printing Plain Text messages with Arial, a proportional font that often ruins the layout of any tabular information. Here are some suggested workarounds for this problem.
- Upgrade to Outlook 2000, which respects the user's choice of fonts when printing Plain Text messages.
- Use File, Save As to save each Plain Text message as a Rich Text Format (.rtf) file, and then open it in Word or WordPad. Select the text, change the font, and print.
- Choose Edit, Edit Message, then Format, Rich Text (HTML) to change the message to HTML format. Select the text, change the font, and print.
How do you print the list of replies to a message that uses voting buttons (revisited)?
When I looked at this question in my May 1998 column, my suggestion was to copy the data on the Tracking tab of a sent voting buttons message and paste it into Microsoft Excel. However, now that you know how to add code to voting button items, you can also produce a report by using the original response data. The trick is getting the response data into a field that appears in the Field Chooser. The VotingResponse field isn't available in the Field Chooser, so you need to use a different field.
Add the code
NewItem.BillingInformation = NewItem.VotingReponse
to the Item_CustomAction() function, after the Select Case ... End Select block, if you use one. This statement copies the user's response to the BillingInformation field. BillingInformation is a handy field that appears in all Outlook items and is available in any Table view but doesn't have a predefined usage. You can use it for whatever you like—in this case, to hold the user's voting button response.
After you receive responses, copy them to a separate folder. Create a new view in this folder, grouping the items on the BillingInformation field. Under each heading, you see a list of everyone who sent in a particular response.
Will forms designed in Outlook 97 and Outlook 98 run in Outlook 2000?
For the most part, yes, but there's one important hitch. Because the Contacts folder in Outlook 2000 can contain Distribution List items as well as Contact items, you absolutely must check each item's TypeName or MessageClass property before you work with any properties that are associated solely with a Distribution List item or a Contact item. If you don't, the code will generate an error if the wrong type of item is present. Actually, this behavior has been a problem all along because you can put a Post item in any Outlook folder. See the Microsoft article "OL2000: How To Handle Unexpected Items in a Collection" (http:// support.microsoft. com/support/kb/ articles/ q222/4/82.asp) for more details and example code.
I've also seen an instance in which an Outlook 98 form with many formula fields couldn't perform all the calculations when the form runs under Outlook 2000. Making the form simpler or moving the calculations to VBScript code are possible workarounds. Notice, too, that in Outlook 2000, Microsoft has renamed the Journal page on the Contact item to Activities.
Will Outlook 2000 forms work in Outlook 97 and Outlook 98?
Yes, unless you use any of the new features in Outlook 2000, such as the Selection object for getting the items selected in a folder view. Remember, though, that the first page of the Contact form is customizable only in Outlook 98 and Outlook 2000. An Outlook 97 user can't open a Contact form with a customized main page.