Mien you add controls to an additional page click Separate Read Layout if you want the Read page iayout to differ from

Figure 5.18 - For the Message form, the Separate Read Layout option is selected for the custom page. If the Separate Read Layout option is not selected for a page, you cannot switch between the Compose and Read pages when the individual page is active. To specify the Separate Read Layout option for a page 1. Click the page for which you want to specify the Separate Read Layout option. 2. On the Form menu, click Separate Read Layout. 3. Repeat for each individual page of the form. Outlook uses...

The Open Event

The Open event occurs when an Outlook form is opened to compose or read an item. When the Open event occurs, the form is initialized but not yet displayed. You can prevent the form from opening by setting the function value to False. The example checks the ReceivedTime property of a message to determine whether the form is in Compose or Read mode. If the ReceivedTime property is not set, the Message page is shown. If the ReceivedTime property is set, the (P.2) page is shown so that the person...

IBeta Contact tems are added to the folder

Figure 3.10 - The Potential Beta Participants view with the Beta Contact items Figure 3.10 - The Potential Beta Participants view with the Beta Contact items Enter Dates in the Beta Participants View Now let's assume you want to send beta agreement contracts to those people who agree to participate in the program. To do this, you use the Beta Participants view to enter the date that the beta agreement contracts are sent. To switch to the Beta Participants view On the Outlook Advanced toolbar,...

The Outlook BarGroups Collection Object

The OutlookBarGroups collection object is one of two critical collection objects used to program the Outlook Bar. Using the Groups object, you can add, modify, or delete groups on the Outlook Bar. The OutlookBarGroups object also supports three events that provide an additional level of programmatic control over Outlook Bar groups GroupAdd, BeforeGroupAdd, and BeforeGroupRemove. The following example creates an Outlook Bar group named Web Links and positions it as the last group on the Outlook...

The Outlook BarGroup Object

The OutlookBarGroup object represents a group on the Outlook Bar. You can manipulate the properties of the OutlookBarGroup object using its Name and ViewType properties. The ViewType property controls whether the shortcuts in the group display with a large or small icon. Use the Item property to access an existing member of an OutlookBarGroups collection object. The following example renames the Outlook Bar group named Web Links that we created in the previous example and changes the shortcuts...

Creating the Outlook Security Settings Public Folder

The next step in the installation process is to create the Outlook Security Settings public folder. This folder should be created by the Exchange administrator who will administer Outlook security settings for your organization. If you want multiple administrators to manage security settings, you must give them Owner permission on the Outlook Security Settings public To create the Outlook Security Settings Public Folder 1. Create a folder named Outlook Security Settings under Public Folders AII...

ViewS witch

The ViewSwitch event occurs when the view in the Explorer window is switched, either through user action or programmatically. Like the FolderSwitch event, this event helps you to control the Outlook user interface by notifying you when either a view or a folder has changed. The following example uses the ShowPane method to hide or display the folder list depending on the current view Private Sub objExpl_ViewSwitch() If objExpl.CurrentView Message Timeline Then objExpl.ShowPane olFolderList,...

Info

ALT+T, and then UP ARROW and DOWN ARROW Search for a keyword in the result list of a prior search. Search for words similar to the keyword. For example, to find words like running and runs for the keyword run. Search only through topic titles. ALT+R Search only through topic titles. ALT+R Add the currently displayed topic to the Favorites list. Select a topic in the Favorites list. ALT+P, and then UP ARROW and DOWN ARROW Remove the selected topic from the list. There are also shortcut menu...

Loading the Company and Company Contact Forms

The Companies and Shared Contacts folders of the Northwind Contact Management application already contain data loaded from the Northwind database. It's helpful to understand how the records in the Customers table in the Northwind database were converted into Outlook forms. As I stated at the beginning of the chapter, in a real-world contact management scenario you'll most likely import companies and company contacts from separate tables in one or many corporate databases. In the case of the...

Click Forms to s set of fields to a

Figure 6.4 - The field set and field list in the Properties dialog box. The following table shows the field sets that are available for each type of form, and where the user-defined fields are created for the form. It also shows whether the Field Chooser is available for the form type. Field sets from built-in forms, such as Appointment, are not available For more information about creating built-in or custom document properties in an Office document, see the online Help for the specific...

Dtw

_tl Conversation jtl Conversation _ J Conversation _ Conversation +1 Conversation +1 Conversation Outlook COM Add-Ins (2 items) Creating Outlook Forms (5 items) Replicating Public Folders (1 item) Document Ubrary views Q item) Core services presentation ( item) interesting Reading Admin 6est Practice (1 item) Admpack HTM Admpack.exe is available on the Office XF Resource Kit. Use Admpack.exe to set custom security settings for Outlook 2002 users. Using Announcements Provides information on how...

The Implied Item Object

In VBScript, when you reference the active item in Outlook, the Item object is implied. Therefore, you do not need to set the Item object when referencing the active item. For example, to set the value of an active item's Subject field, you can use the following statement Item.Subject This is a test You can also leave out the reference to the item, as shown in this example Subject This is a test 1. On the Outlook Actions menu, click New Mail Message. 2. On the form's Tools menu, click Forms,...

Edit the Read Page

Quite often, the Compose and Read pages of a form are very similar. As a result, you can design most of the Read page by copying controls from the Compose page. As a rule, you must edit the pages of the Read page if the page has a separate read layout. Each individual page of the form has its own Read or Compose page if Separate Read Layout was selected for that page. 1. On the Form Design toolbar, click Edit Read Page. 2. Click the individual page you want to edit. 3. Adjust or remove any...

Create the Product Idea Form

The Product Idea form that you create will enable users to post new ideas to the Product Ideas folder. The Product Idea form is based on the standard Outlook Post form. TheOutlook Post form supplies most of the required functionality all you need to do to build the Product Idea form is add and remove some controls and then set a few properties for the controls and the form. To design the Product Idea form, you'll modify the Compose page of the Post form, as shown in Figure 4-6. Figure 4.6 - The...

Item Events

We've covered many of the application-level events available in Outlook 2002. Do you believe that you're ready to move to the head of the class yet You can go beyond what you've learned so far and raise item-level events in addition to application-level events. You should be aware that Outlook 2000 introduced several new item-level events, including AttachmentAdd, AttachmentRead, BeforeAttachmentSave, and BeforeCheckNames. Outlook 2002 offers an additional item-level event the BeforeDelete...

Modify Forms

Quite often, changing a form can affect other forms or folders. When modifying a form, here are some things to consider If a view or rule is based on a particular field and you remove or modify that field name, the view or rule must be updated to reflect the change. If fields are renamed on an existing form, their associated field values in items created using a previous version of the form do not appear on the new form. If the form contains VBScript code, any changes you make to the form...

Msg Box Click OK to Reset Web View vblnformation MyFolder WebViewOn False Reset Reinstantiate the MAPIFolder object

Set MyFolder MyNS.GetDefaultFolder(16) 'Drafts folder MyFolder.Display End Sub In addition to the InAppFolderSyncObject property discussed previously, Outlook 2002 adds some MAPIFolder properties that are worth noting. The ShowAsOutlookAddressBook property determines whether a Contacts folder will be displayed as an Outlook Address Book. If the folder is not a Contacts folder, setting the property has no effect. The AddToPFFavorites property adds a public folder to the Favorites folder so that...

Permission levels predefined Roles

Figure 8.35 - Permissions for the Classified Ads folder. Modify the Name List. Permissions can be set for folders in your Mailbox or public folders. Permissions cannot be set for personal folders. 1. In the Folder List, right-click the folder you want to set permissions for, and then click Properties on the shortcut menu. The names in the Name list box determine who can view and use the folder. If you create the folder, you are automatically given owner permissions for the folder. With owner...

Postltem Object Methods

The Postltem object provides a variety of methods that you can use to control the actions of an item. This section covers the Copy, Move, Delete, Display, and Post methods. You can use the Copy method of the Postltem object to create a copy of an item. You can then use the Move method to move the copied item to a new location. The example returns the first item in the Product Ideas folder with the value Boating in the Product Category field. It then uses the Copy method to create a copy of the...

All Local variables as Statics

Figure 9.5 - Use the Add Procedure dialog box to create a Sub procedure for an Outlook macro. Once you have created your macro procedure and debugged it, you'll want to customize either an Explorer or Inspector toolbar so that you can run the macro with a mouse click. Be aware that you must lower your Macro Security settings to Low or Medium in order to run any VBA macro code. In order to test the LaunchWordMail macro, you can simply insert the cursor into the LaunchWordMail Sub procedure in...

The Attachment Add Event

The AttachmentAdd event occurs when an attachment is added to an item either through a user action or by a procedure that uses code to add an Attachment object. The following VBScript example checks the size of the item after an embedded attachment has been added and displays a warning if the size exceeds 250,000 bytes Sub Item_AttachmentAdd(ByVaI NewAttachment) Const olByValue 1 If NewAttachment.Type olByValue Then If Item.Size > 250000 Then MsgBox Warning Item size is now _ & Item.Size...

Building a COM AddIn

Now that we have a template project available in Visual Basic 6, we can walk through the steps of building a COM Add-in. After you have created and saved a new project using the Outlook COM Add-In template, you need to save some settings that control the load behavior of your COM Add-in. The Add-In Designer for the Outlook COM Add-In project is a class module with a user interface that lets you set properties for the Add-in. Figure 14-6 shows the AddlnDesigner dialog box for Connect.dsr in the...

Opq

Figure 15.24 - Shared Journal can track company-related activities such as phone calls and presentations Figure 15.24 - Shared Journal can track company-related activities such as phone calls and presentations Web Part communication is what makes the Northwind Dashboard operate. Because the Outlook 2002 View Control supports events in general and the Selection Change event in particular, you can write a Web Part event handler. The Notification Service of the Digital Dashboard Services Component...

The Documentltem Object

The Documentltem object represents an assortment of different items that can be stored in Outlook folders. To clarify what a Documentltem object represents, the terms extrinsic and intrinsic Documentltems need to be defined. A Documentltem object can be a file that is dragged to an Outlook folder from Windows Explorer. It can also result from a file posted to an Exchange public folder from a source application such as Microsoft Word, Excel, or PowerPoint. These items are extrinsic Documentltem...

The Views Collection Object

The Views collection object, which is new in Outlook 2002, is a property object of the MAPI Folder object. You can use the Views collection object to enumerate the Views in a folder or to obtain a child View object and change the View programmatically. You can also use the Add method to add a View to a folder. The following example creates a View named Larger View in the CurrentFolder object of the ActiveExplorer object. For a more thorough explanation of modifying Views programmatically with...

Gju

File Blocked by Outlook 98 and Blocked by Outlook 2002 Extension 2000 Default Default .prf Microsoft Outlook Profile Settings X .reg Registration entries X X .scf Windows Explorer command X .scr Screen saver X X .set Wndows script component X X .shb Shortcut into a document X X .shs Shell scrap object X X .url Internet shortcut X X .vb VBScript file X X .vbe VBScript-encoded script file X X .vbs VBScript file X X .wsc Wndows script component X X .wsf Wndows script file X X .wsh Wndows Scripting...

Create the Product Idea Response Form

The Product Idea Response form, as shown in Figure 4-15, is very similar to the Product Idea form. Therefore, to create the Product Idea Response form, all you need to do is modify a few properties of the original Product Idea form, change the form name, and then publish the form in the Product Ideas folder. Figure 4.15 - The Compose page of the Product Idea Response form. Figure 4.15 - The Compose page of the Product Idea Response form. To edit the Compose page, you change several properties...

Iorm modules to This OutlookSession Members list bcK and press F for

Vba Object Model

Figure 10.6 - The Microsoft Outlook Visual Basic for Applications Object Browser. Figure 10.7 - The Microsoft Outlook Object Model. To view the Microsoft Outlook Object Model Figure 10.7 - The Microsoft Outlook Object Model. To view the Microsoft Outlook Object Model 1. On the Script Editor Help menu, click Microsoft Outlook Object Library Help. 2. Click the Contents page in the Microsoft Visual Basic Reference Help window. 3. Open the Microsoft Outlook Visual Basic Reference Help book, and...

Properties of the Name Space Object

The NameSpace object provides two properties that you use quite often. These are the CurrentUser and Folders properties. Returning the Name of the Current User You can use the CurrentUser property of the NameSpace object to return the name of the currently logged-on user. This example shows the current user's name in the message box when the CommandButton control is clicked Set MyNameSpace MsgBox MyNameSpace.CurrentUser End Sub You can use the Folders property of the NameSpace object to...

Tools Needed to Create COM Addins

To create an Outlook COM Add-in, you should obtain Visual Studio 98 Professional Edition or Visual Basic 5 Professional Edition. Visual Studio 98 is the preferred development tool because you can use Visual InterDev 6 to customize folder home pages, as well as Visual Basic 6 to create COM Add-ins. You can also create COM Add-ins for Outlook with Microsoft Office XP Developer. If you don't have Office XP Developer, you can develop a project using ThisOutlookSession and Outlook Visual Basic for...

Folder Home Page Security

In Outlook 2002, you can associate a Web page with any mailbox or public folder. Folder home pages either use zone security and allow script access to Outlook Object Model, or they use zone security only. Using Zone Security and Allowing Script Access to the Outlook Object Model This mode is the default for Outlook 2002, and it gives scripts on a Web page access to the Outlook Object Model. It also ensures that the Outlook Today ActiveX control discussed in a moment runs continuously....

J

Documentation before modifying these settings. Miscellaneous Attachment Settings Show level 1 attachments R Allow users to lower attachments to Level 2 Do not prompt about level 1 attachments when sending an item Do not prompt about level 1 attachments when dosing an item P Allow n-place activation of embedded OLE objects Show OLE package objects Users wili not have access to these attachments, Add Example EXE COM 5H5 BAT Users can save but not open these attachments in Outlook r Enable scripts...

Adding Events to VBScript Behind Forms

By using the Script Editor, you can add code to an Outlook item event to modify the event's behavior. For example, for the Open event, you can add code to specify the current form page, or you can add code to load a ComboBox control with a recordset from a database. For the Click event, you can create a procedure that creates a custom item, includes an attachment to the current item, and then posts the item in a folder. Item events are available for all Outlook item types except for the...

The Outlook BarShortcuts Collection Object

OutlookBarShortcuts is a property collection object for the OutlookBarGroups object. You use this collection object to add, modify, or remove shortcuts from an Outlook Bar group. Like the OutlookBarGroups collection object, OutlookBarShortcuts supports three events you can use when you write event procedures to be executed when an Outlook shortcut has been added or removed. These events are ShortcutAdd, BeforeShortcutAdd, and BeforeShortcutRemove. The OutlookBarShortcut object represents a...

Items Collection Object Methods

This section covers the Add, Find, and Restrict methods of the Items collection object. Creating a Custom Item With Outlook, there are two basic methods of creating items. Standard items such as Message items IPM.Note , Post items IPM.Post , and Contact items IPM.Contact are created using the Createltem method of the Application object, as discussed earlier in this chapter. To create custom items, however, such as an IPM.Post.Product Idea item, you use the Add method of the Items collection...

About the Control Toolbox

The Control Toolbox identifies the controls you can add to a Frame or page of a form. You can customize the Control Toolbox in many ways, including the following Add pages to the Control Toolbox. Right-click on the Control Toolbox page tab, and select the NewPage command. Move controls from one page in the Control Toolbox to another. Right-click on the Control Toolbox page tab, and select the Move command. Rename Control Toolbox pages. Right-click on the Control Toolbox page tab, and select the...

Testing

Figure 11.8 - The Testing command bar. The code required to create Testing is relatively straightforward. It's presented in sections so that you can clearly understand each step of the coding process. The first order of business is to instantiate a CommandBar object so that controls can be added to the command bar's CommandBarControls collection. The next line attempts to instantiate a Testing CommandBar object from the Explorer's Command Bars collection. If Testing already exists and no error...

The Package and Deployment Wizard

Once you have developed, debugged, and secured your COM Add-in, you can create an installation setup program with either the Setup Wizard, if you are using Visual Basic 5, or the Package and Deployment Wizard if you are using Visual Basic 6. If you use the Visual Basic 5 Setup Wizard, you must add code to the setup program to ensure that the correct registry settings will be created for your Add-in. See Add-In Registration earlier in this chapter for the correct registry key names and values...

Chapter The Northwind Contact Management Application

The Northwind Contact Management application uses the Microsoft Access 2002 Northwind sample database to populate a set of folders that showcase the contact management features of Microsoft Outlook 2002. Of course, every user has the ability to manage his own contacts using the Contacts folder in his personal mailbox. However, organizations need to manage and share contact information beyond the confines of their users' personal contact lists. Outlook 2002 improves upon the ability of previous...

Displaying the List of COM Addlns

Outlook's COM Add-lns dialog box shown in Figure 14-2 is buried deep in the Tools Options dialog box. If you are developing COM Add-ins, you'll want to customize your Standard or Advanced Explorer toolbar and place a command bar button on the toolbar to provide a shortcut to the COM Add-lns dialog box. Add-lns available Items Command 3ar Outlook 2000 Team Folders Wizard 9,0,0,3217 Outlook Shared Activities Add-In P Outiook today Add-In Location C Program Files ZipOut

Ok

Location D WINNT System32 COMCT332.00i Figure 5.19 - You can add additional controls to the Outlook Control Toolbox by using the Custom Controls command and selecting controls in the Additional Controls dialog box. To add additional controls to the Control Toolbox 1. Right-click the bottom of the Controls page in the Control Toolbox, and then click Custom Controls on the shortcut menu. 2. Under Available Controls, click the controls you want to enable, and then click OK. To add a control to a...

MAPIFolder Object Properties

This section covers the DefaultMessageClass, FolderPath, Folders, InAppFolderSyncObject, Items, Parent, Child, EntrylD, StorelD, UnReadltemCount, and WebViewURL properties. The Folders property is useful for accessing a folder in the folder list. The Items property is useful for retrieving a collection of items in the folder. Referencing a Folder in the Folder List You can use the Folders property with the MAPIFolder object to return another MAPIFolder object. The OpenMAPIFolder function shown...

Open the Form and Switch to Design Mode

When you design an Outlook form, you always start with an existing form. Outlook lets you choose from a variety of standard and custom forms. In addition to forms supplied in Outlook, you can design forms based on custom templates created by others in your organization. To open a form and switch to Design mode, first select the folder in which you want to create the form. Then select the type of form you want to open, such as those in the following sections. To close a form, click the Close...

Publish the Form

When you finish designing a form, you publish it to a forms library. Optionally, you can make a backup copy of the form, although it is not required. When you publish a form, you register the form in a forms library and expose the form to the Outlook user interface. For example, after the form is published, the form menu commands and form name are visible in the Outlook user interface. When you make a backup copy of the form, you save the form definition as an Outlook Form Template or .oft...

Visible False End With End

The Deactivate event occurs when the Inspector window ceases to be the active window because of a user action or program code. The same cautions mentioned earlier regarding the Deactivate event of the Explorer window apply to the Inspector window. Do not display user interface elements in the Deactivate event procedure. The following procedure hides the built-in Clipboard Command bar. In the Deactivate event, you cannot use the Currentltem property to return properties of the item. If you...

Tools to Create Folder Home Pages

To create folder home pages, you can use any of the tools listed next. If you become a serious folder home page developer, you will use a combination of these tools or maybe a third-party authoring tool not listed in the following table. If you want to customize your folder home pages, you should consider Microsoft Visual Studio 98 Professional, Visual Studio 98 Enterprise edition, or a later version as the tool of choice. Because Visual Studio ships with both Visual Basic and Visual InterDev...

Options PagesAdd

Outlook Propertypage

Oddly enough, the NameSpace object supports only one event, the OptionsPagesAdd event. This event is the first cousin of the OptionsPagesAdd event for the Application object. OptionsPagesAdd for the NameSpace object occurs before a Folder Properties dialog box is displayed for a folder. The folder for which the Folder Properties dialog box is displayed is then passed as a MAPI Folder object to the event procedure for OptionsPagesAdd. You can use the OptionsPagesAdd event of the NameSpace object...

Extending Your Application with Public Methods

The basic functionality of the Outlook Shared Activities COM Add-in centers around the addition of an Explorer toolbar. In this respect, this add-in is typical. However, it has some special features that allow you to extend your application beyond the addition of Explorer toolbars. For example, VBScript code behind forms cannot make Windows API calls. The Outlook Shared Activities COM Add-in wraps Telephony Application Programming Interface TAPI Calls in a public method Dial Phone. A similar...

Controls Collection Object Properties

The Controls collection object provides only the Count property. With the Count property, you can use the For Next statement to loop through the controls in a collection. The following example returns the collection of controls on the Controls collection object page. It then displays the name of each control contained on the page. Sub ShowtheControlsCollectionCount_Click Set Page Object Set MyControls Page.Controls For i 0 to MyControls.Count -1 MsgBox MyControls i .Name, vblnformation Next End...

Item Remove

The ItemRemove event occurs when an item is removed from a specified Items collection object, either through user action or programmatically. The following example expands on the FolderRemove example described earlier to show how to undelete an item programmatically. This example undeletes a custom form with a message class of IPM.Post.ContactSettings if a user deletes the item from the Settings subfolder of the Inbox. 'Place these declarations in the general section of ThisOutlookSession...

Writing Code to Respond to Events

Outlook macros are very useful for simple repetitive tasks. However, macros are only a snack compared with the banquet of events available in the Outlook 2002 Object Model. For Visual Basic developers, the key to writing code that responds to events is learning how to use the WithEvents keyword in Visual Basic. Use the WithEvents Keyword to Declare Object Variables The WithEvents keyword is used to dimension an object variable in a class module. If you attempt to use WithEvents in conjunction...

Command Bar Caveats

There are a couple of issues you should be aware of when creating COM Add-ins that display custom command bars or command bar buttons. If you want your command bar button to display custom icons, you must explicitly set a reference to the Microsoft Office 10.0 Object Library. The Office XP CommandBarButton object supports a Picture and a Mask property that letyou use custom images for your command bar buttons. If you need your COM Add-in to run in both Outlook 2000 and 2002, you must set the...

Copy the Folder to Public Folders

Now you've created forms and a custom view for the Product Ideas folder. You've also tested the folder to make sure it works as planned. Now copy the folder from the Design Environment personal folder to public folders so that the folder can be shared by a workgroup or across the entire organization. Before you copy the folder, you might want to discuss with your administrator the best location for the folder. In addition, you might need to get the appropriate permissions to copy the folder to...

Specify the Default Form for the Folder

Now that you've created a custom form, you may want to run it to see if it works as expected. However, at this point, there are two possible forms that you can open. One form is the built-in Contacts form that's provided with Outlook. The other is the Beta Contact form you created. If you click the New Contact button on the Standard toolbar, the built-in Contacts form appears. You must click New Beta Contact on the Outlook Actions menu to open the Beta Contact form you created. To avoid this...

The Application Object

The Application object sits at the top of the object model and represents the entire Outlook application. The Outlook Application object has several purposes As the root object, it enables you to reference other objects in the Outlook object hierarchy. It provides methods such as Createltem and CreateObject so that you can create new items and reference them without moving through the object hierarchy. It provides methods for directly referencing the active Outlook window or form. For a...

The Forms Cache

The forms cache is a local file system folder that serves as a forms storage location. The forms cache improves the load time of a form because commonly used forms are loaded from the hard disk rather than downloaded from Microsoft Exchange Server. When a form is activated for the first time, the form definition file is copied from its forms library to the user's Forms folder. The forms cache keeps a temporary copy of the form definition in a subfolder whose name roughly matches the name of the...

Explorer Events

Explorer events provide you with a great deal of control over the Outlook user interface. You can now control the size and window state of Explorer windows, respond to selection changes through the new SelectionChange event and the Selection object, and determine when the user has changed her view or the current folder. Outlook 2002 adds a group of events that provide a granular level of control over the Outlook application window. These events are BeforeMaximize, BeforeMinimize, BeforeMove,...

Hen

Vba Designer Control

This procedure create an Access table linked to the Outiook Contact folder, Access, Excel, or Word 2000 or Greater Microsoft Outlook9,0 Object Library or higher Reference checked Function LinkEHchangeE'oider strTabieName As Boolean This procedure creates an Access tahle linked to the Outlook Contf ts folder l' l in dbsDatabase As DAO.Database Dim tdfTable As DAO TableDef Dim strConnect As String 1 Set a reference to the current database. Set dbsDatabase CurrentDb strConnect Exchange 4...

Item Add

The ItemAdd event occurs when an item is added to an Items collection object, either through user action or program code. The following example creates an Items collection object for an Exchange public folder named Customers that contains Contact items. When a new customer is added to the Customers folder, a message is sent to a distribution list for the correct regional sales team. This example requires another event procedure in order to instantiate the collection object for the Customers...

The Property Change Event

The PropertyChange event occurs when one of the item's standard fields such as Subject, To, Importance, or Sensitivity changes. Because the field name is passed to the procedure, you can use the Select Case statement to determine which field value has changed. In the following example, a message box shows the values of the Importance and Sensitivity fields that have changed. To see how it works, add the following code to the Script Editor. Then exit Design mode and change the values in the...

Address Entry Object Methods

This section covers the Details, Update, Delete, and GetFreeBusy methods of the AddressEntry object. Displaying Details of an Address Entry The Details method of the AddressEntry object displays a modal dialog box that lets a user see and, if permissions allow, change the information stored in the Address Book item represented by the object. The following example steps through the items in a user's Personal Address Book, using the Details method to display the information contained in each...

End Sub Address Entry Properties

You can use such properties as Name, Address, Members, Type, and Manager to retrieve useful information contained in the item. For a complete list and description of the methods and properties for the AddressEntry object, see Microsoft Outlook Visual Basic Reference Help. The following example uses the Members, Name, and Address properties of the AddressEntry object to display the name and address of each member of a private distribution list named Department Sub Displayl_istMembers_Click On...

Inspector Object Methods

This section covers the SetCurrentFormPage, HideFormPage, and ShowFormPage methods of the Inspector object. Setting the Current Form Page You can use the SetCurrentFormPage method of the Inspector object to set the current form page of a form. The following example shows the Details page as the current form page of a Contact form when you click CommandButtonl. To use this example, you must add a command button to a Contact form in Design mode. Add the code in the Script Editor, and then run the...

Distribute Forms

This section provides information, strategies, and instructions for distributing forms in your organization. It covers how to Make forms available in the Organizational Forms Library, the Personal Forms Library, or a Folder Forms Library. Change the standard IPM.Note message. Send a form to an administrator or to another user. Distribute forms in a personal folder .pst file. Make forms available for offline use. Make Forms Available in the Organizational Forms Library Most often, the types of...

The Command Bars Collection Object

The ability to program the Outlook Bar gives you a significant level of control over the Outlook user interface. Using the OutlookBarGroups and OutlookBarShortcuts events, you can prevent a user from removing an Outlook Bar group or shortcut that is essential to your application. You can also dynamically add Outlook Bar groups and shortcuts. You don't have the same flexibility, however, with Outlook Bar objects as you do with all the objects belonging to Office command bars. CommandBar and...

Eyy

IP-M P, 6 All Fields Properties Actions rhe Total Days control is bound to the 1 Total Days field It shows the result of the values in the StartDate and End Date fields. Figure 6.17 - Label controls on the Vacation Request form. When to Bind a Label Control Generally, you bind Label controls to fields when you want to save the value to the item. For example, in the Vacation Request form, as shown in Figure 6-17, the Total Days label is bound to the TotalDays field. In this way, the value in the...

Lxk

Outlook View Control Activities

The View drop-down list allows the user to select Views for the folder select in the Show drop-down lis Figure 12.3 - The Shared Activities page uses the Outlook View Control to display information in shared folders. Figure 12.3 - The Shared Activities page uses the Outlook View Control to display information in shared folders. The Northwind Contact Management application also makes use of the PivotTable List ActiveX control in Microsoft Office XP. An Office XP Web Component, the PivotTable...

The Label Back Style property is set to Transparent in the Advanced Properties dialog box

Figure 6.3 - The BackStyle property of the Labelz control is set to Transparent, so the control appears to be part of the Image 1 control behind it. of available fields in the field list in the Properties dialog box, as shown in Figure 6-4. To bind a control to an existing field 1. Right-click the control you want to define a field for, and then click Properties on the shortcut menu. 3. Click Choose Field, point to the set of fields you want, and then click the field. The sets of fields...

Outlook Security

Perhaps the most significant new feature of Outlook 2002 is the Outlook E-Mail Security Update. Introduced in response to the damage wrought by e-mail viruses such as Melissa and ILoveYou, the Outlook E-Mail Security Update was offered originally as a patch for Outlook 2000 SR-1 a and Outlook 98. This update is not available for Outlook 97. In Outlook 2000 SP2 and Outlook 2002, the Outlook E-Mail Security Update is built into Outlook. It cannot be removed, and administrative control is...

L The item is posted in the folder and grouped according to selections on the form

Figure 8.14 - The Classified Ad form. If your application makes use of custom forms, you should consider enforcement of validation rules to ensure that views are complete and logical for the user. A validation rule on a user-defined field requires that a given field have a value, or one value from a range of possible values. To group items by using Customize Current View 1. On the View menu, select Current View, click Customize Current View, and then click Group By. 2. In the Select Available...

Select

lt table border 0 cellpadding 0 cellspacing 0 style width 100 gt lt tr gt lt td width 30 align left gt lt SELECT id cmbView_WPQ_ class select style display none lt OPTION lt td colspan 2 width 20 gt lt td gt lt td width 10 align left valign center gt lt span id AdvFindltem_WPQ_ class SPAN_WPQ_normal amp nbsp amp nbsp Find lt span gt lt td gt lt td width 10 align left valign center gt lt span id Newltem_WPQ_ class SPAN_WPQ_normal amp nbsp amp nbsp New lt span gt lt td gt lt td width 10 align...

Only items created wit the Classified Ad form show in the folder

Figure 8.21 - The filter for the By Ad Type view shows only items created with the Classified Ad form I PM. Post. Create Ad in the folder. Filters consist of a condition or set of conditions that determine what items are shown in a folder. For example, a condition could be From Jim Hance. Conditions can have multiple arguments. For example, From Jim Hance Don Funk. Here are a few simple guidelines to follow when creating conditions Multiple conditions are logical AND values For example, the...

Sa M s

Controls selected in the Additional Controls dialog box will be added to your Outlook toolbox, Microsoft Chart Control, version 6.G OLEDB Microsoft Communications Control, version K'itj Microsoft Coolbar Contrai, version .D Li Microsoft DataCornbo Control, version S. OLhD Microsoft DataGrici Control, Version 6. I OLEDB Microsoft DataList Control, version E.O OLEDB Microsott DataRepeaier Control, version .0 3 Microsoft Date and Time Picker Control, version E Microsoft DBCombo Control, version...

Visual Studio Installer

Visual Studio Installer uses the Windows Installer to package and deploy your COM Add-in. If you plan to distribute a COM Add-in commercially, a Windows Installer setup is the preferred installation technology. Office XP uses Windows Installer 1.1, and Visual Studio Installer has been upgraded from its initial 1.0 release to support all the features of Windows Installer 1.1. Obtain Visual Studio Installer 1.1 by visiting Here is just a short list of the features Visual Studio Installer 1.1...

Using CDO to Obtain Recipients

Collaboration Data Objects CDO is an object model that assists in building messaging and collaboration applications. CDO serves as a complementary object model to manipulate MAPI folders and items from Visual Basic or VBScript code. You can use CDO to access messaging objects which are not available in the Outlook Object Model. For example, the Address procedure shown next lets you present an AddressBook dialog box to the user. When the user makes recipient selections from the AddressBook...

The Before AttachmentSave Event

The BeforeAttachmentSave event occurs just after the ltem_Send event and just before the ltem_Write event. BeforeAttachmentSave always occurs after the AttachmentAdd event. This event is cancelable. If you're sending an item that contains an attachment and you cancel BeforeAttachmentSave, you will also cancel the ltem_Write event. The following example prevents the user from saving an .exe file as an attachment Function ltem_BeforeAttachmentSave ByVal SaveAttachment Const olByValue 1 If...

Reminder Remove

This event occurs when a Reminder item is removed from the Reminders collection. Because the ReminderRemove event does not pass a ReminderObject, you cannot determine which reminder has been removed from the Reminders collection. A reminder is removed from the Reminders collection when any of the following events occur A reminder is dismissed programmatically or by a user action. A reminder is turned off programmatically or by a user action in the item containing the reminder. The item...

The Forward Event

The Forward event occurs when the user initiates the Forward action on a form-usually by clicking the Forward button. You can prevent the form from being forwarded by setting the function value to False. In the following example, the Forward event is prevented from firing if the message is confidential Function ltem_Forward ByVal MyForwardltem If Item.Sensitivity 3 Then MsgBox This message is confidential and cannot be forwarded., _ vbCritical ltem_Forward False End If End Function

Cqx

Use Edit.Revise Contents menu to edit Members. Warning Lowering any of the default security settings may increase your risk of virus execution arid or propagation. Use caution and read the documentation before modifying these settings. Miscellaneous Attachment Settings Show level 1 attachments Allow users to lower attachments to Level 2 Do not prompt about level 1 attachments when sending an item Do not prompt about level 1 attachments when dosing an item Allow in-place activation of embedded...

Preventing Events from Firing

In some cases, you might want to prevent events from occurring. For example, you might want to add code for a Reply event that opens a custom form rather than the default Message form. To achieve this functionality, you must first prevent the default behavior from occurring. To do so, assign False to the function value. The actual Event procedure must be declared as a Function procedure instead of a Sub procedure so that you can cancel an Item event with an ltem_EventName False statement....

Set Permissions

With Permissions, you define who can open the folder and what functions they can perform in the folder. When you create a folder in Outlook, you are automatically given an Owner role for the folder. This means you have full permissions to create, edit, and delete items in the folder, and you have full permissions to change any folder properties. When you create a public folder under All Public Folders, the Default role is set to Author. If the public folder is a subfolder of an existing public...

The Command BarControls Collection Object

CommandBarControls is a collection object that represents all the controls on a command bar. You use the Controls property of a CommandBar object to refer to a control on a command bar. The Controls property is a CommandBarControls collection. If the control is of the type msoControlPopup, it also will have a Controls collection representing each control on the pop-up menu. Pop-up menu controls represent menus and submenus and can be nested several layers deep, as shown in the second example in...

B

ThisOutlookSession E Forms 13 Modules Cj Class Modules AduancedSearchCompk AduancetiSearchStoppe ItemSend Private Sub Application Orj Error Resume iiex 1 Instantiate object Set objNS Applies Set colExpl Appli Set collnsp Appli Set obJExpl Appli Set colInbox Items Set colInboxFolders objNS.GetDefau Set eolDeletedltems objNS. Get-Defau Set colDeletedltemsFolders objNS.G 'Create gobjCDO Session object and 1 Set jobjCDO CreateObject MAPI. Ses gobjCDO.Logon False, False Call CBOutlookltems...

The Outlook Script Editor

Script Editor Outlook

With the Script Editor, which is available for each form, you can add procedures to forms to control an Outlook application or another application such as Microsoft Word or Microsoft Excel. Remember, however, that if your primary purpose is to control the Outlook application rather than an Outlook form, you should be using VBA or Visual Basic instead of VBScript behind forms. In addition, you can create procedures to control Outlook folders, forms, items, controls, and properties in items. For...

The Appointmentltem Object

An Appointmentltem object represents an appointment in the Calendar folder. An Appointmentltem object can represent a one-time appointment, a meeting, or recurring appointments and meetings. A meeting usually involves more than one person and is created when an Appointmentltem is sent to other users, who then receive it in the form of a Meetingltem object in their respective Inbox folders. An appointment or meeting can be recurring-that is, set to occur more than once on a regular or repetitive...

Displaying an Explorer Toolbar

When a user navigates to the Companies folder, the Create Shared Items toolbar shown in Figure 12-5 is displayed in the Outlook Explorer window so that the user can create a shared item without opening the form in the folder. Explorer toolbars provide a professional touch to your application and guide the user in ways that were not possible in Outlook 97 and Outlook 98. In the Northwind Contact Management application, a COM Add-in creates the Explorer toolbar. To provide an Explorer toolbar...

Contactltem Object Methods

This section shows you how to forward a Contact Item as a vCard, the Internet standard for creating and sharing virtual business cards. This example uses the ForwardasvCard method to forward a vCard attachment for a Contact in a Mail Message. The ForwardasvCard method returns a Mailltem with the vCard file attached. Sub SendAsvCard_Click Const olContactltem 2 On Error Resume Next Set myContact Application.Createltem olContactltem myContact.FirstName Nancy myContact. LastName Davolio...

The Shared Journal Folder

The Shared Journal folder consists of three custom views that organize the shared journal items the Entry List By Company, Entry List By Created By, and Entry List By Created On views. These views depend upon user-defined fields specified in the Shared Journal custom form. This folder provides managers with a picture of which sales personnel have accomplished an activity for a Company item on a given day. The Created By and Created On user-defined fields are set when a shared journal item is...

The Check Box control provides an OnOff or YesNo choice

To bind a CheckBox control to a field 1. Right-click the CheckBox control, and then click Properties on the shortcut menu. 2. On the Value page, do one of the following Click New to create a new field. You can create a Yes No, On Off, True False, or Icon field. When you select a Yes No field, the selected value appears in the cell in the folder. If you select Icon, the CheckBox icon appears in the Click Choose Field, point to User-Defined Fields In Folder, and...

Myu

LThe Control name on the form for Outlook View Control is ctlViewContacts. Figure 12.17 - Script-level control variables duplicate the actual control names. Create a script-level control variable named ctlViewContacts, and instantiate this variable in the form's ltem_Open event. The Outlook 2000 View Control, which was made available on the Web after the initial release of Outlook 2000, is an ActiveX dynamic-link library DLL component of the Outlook Team Folders Kit. In Outlook 2002, the new...

The Controls Collection Object

To access controls on Outlook forms, you use the Controls collection object. The Controls collection object contains the collection of controls on a form page. To access an individual control in the Controls collection, you use the index value of the control or the name of the control. The Controls collection object is contained in the Microsoft Forms 2.0 Object Library. This section discusses how to reference control collections and controls on a form. Open the Control object item in the...

The Address Lists Collection Object

Outlook users often have several address books from which they can select recipients for a message. The AddressLists collection object contains all the address books available to a user. Using the AddressLists object, you can reference one or more AddressList objects, each of which represents a single address book. Open the AddressLists collection object, AddressEntries collection object, and the AddressEntry object items in the VBScript Samples folder to work directly with this code in...

Sync Object Events

A child object of the NameSpace object, SyncObject represents a Send Receive group that controls offline synchronization in Outlook 2002. In Outlook 2000, a Send Receive group is known as a Quick Synchronization group. You cannot establish a SyncObject programmatically by using an Add method of the SyncObjects collection object. Both the SyncObjects collection object and the SyncObject object are read-only objects, meaning that you cannot change the properties of a SyncObject or create a new...

Automation

In addition to using VBScript or Visual Basic to program Outlook forms and COM Add-ins, you can use Visual Basic to program Outlook objects remotely. In order to enhance security, programs that automate Outlook externally will always be subject to the object model guards of the Outlook E-Mail Security Update. You use Automation when you want to control an entire session. For example, you may want to automatically send a message from within a Visual Basic or Microsoft Excel application. To...

The Reply Event

The Reply event occurs when a user clicks the Reply button on the form. When this event occurs, the newly created Reply item is passed to the procedure. You can prevent the item from being sent by setting the function value to False. The following example prevents the standard Reply event from occurring and creates an item with a custom Task form. The code then copies the values from the item's Subject and To fields to the Task Response item. Function ltem_Reply ByVal Response ltem_Reply False...

Private Sub objExpl BeforeFolder SwitchByVal New Folder As Object Cancel As Boolean

If NewFolder Is Nothing Then Exit Sub Set objAE If lsDLMember HR Admins,objAE False Then If NewFolder.Name Salary Guidelines Then MsgBox You do not have permission to access this folder. _ amp vbCr amp If you believe you should have access to this folder, amp vbCr amp please contact your departmental HR supervisor., _ vbCritical Cancel True End If End If End Sub It NewFolder is a folder in the file system, then NewFolder is Nothing. Your code should provide for this possibility. The...

Recipients Collection Object Methods

This section covers the Add and ResolveAII methods of the Recipients collection object. For a complete list and description of the properties and methods for the Recipients collection object and the Recipient object, see Microsoft Outlook Visual Basic Reference Help. You can use the Add method of the Recipients collection object to add recipient names to the Recipients collection. The following example creates a new Message item and then uses the Recipients property of the Mailltem object to...

Make the Folder Available for Offline

Outlook 2002 Offline

A strong point of Outlook application development is the program's ability to make folders available on line and off line. If your application requires both online and offline use, you will need to make the folder and any custom forms contained in it available for offline use. For an example of an application that operates on line and off line, see Chapter 12. The Northwind Contact Management Application. By using some of the new properties and methods in the Outlook 2002 object model, you can...

Reg Dwori

My Figure 14.7 - COM Add-in settings in the Windows Registry Editor. Controlling Initial Load Behavior You control the initial load behavior of your COM Add-in by setting the Initial Load Behavior drop-down list box on the General page of the AddlnDesigner dialog box. If you are not using a Visual Basic 6 Add-In Designer to create your COM Add-in, you can set the initial load behavior directly by assigning the correct DWORD value to the LoadBehavior key in the Wndows registry. Notice in the...

Reminders Collection Events

The Reminders collection object is new to Outlook 2002 and is a child object of the Outlook Application object. The Reminders collection object represents all the Reminder items stored in the hidden Reminders folder of the mailbox of the user who is logged on. Reminder items include appointment reminders, task reminders, and follow-up flags for Mail and Contact items. Several new events for the Reminders collection object give you granular control over Reminder items. Because the Reminders...