Compartilhar via


What's New for Developers in Outlook 2007 (Part 1 of 2)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Summary: Learn about the enhancements and additions for developers in Outlook 2007. This article provides a deep dive into some of the new and enhanced objects in the Outlook object model and their properties, methods, and events. It is accompanied by the What's New Add-ins, which are available as a download on the Microsoft Download Center. If you want to get a jump start on the Outlook platform, the article and the add-ins will provide sufficient detail for you to begin coding against Outlook 2007. (25 printed pages)

Randy Byrne, Microsoft Corporation

May 2006

Applies to: Microsoft Office Outlook 2007

Download: Outlook 2007 Sample: What's New Add-Ins

Contents

  • Overview of Outlook 2007 Improvements

  • Enhancements and Additions to the Outlook Object Model

  • What's New Add-Ins

  • Form Regions

  • Security

  • Conclusion

  • Additional Resources

Overview of Outlook 2007 Improvements

Microsoft Office Outlook 2007 introduces significant new improvements in its object model and forms technology in order to accommodate developer requests and provide a more comprehensive platform for Outlook-based solutions. The following are the pillars of the Outlook 2007 extensibility vision:

  • Unification, so that you will no longer have to rely on Microsoft Collaboration Data Objects (CDO) 1.21, Microsoft Exchange Client Extensions, or other third-party libraries to complete your solutions. APIs such as CDO 1.21 are unsupported for managed solutions. The Outlook object model is fully supported for Microsoft .NET development.

  • Performance, so that you will not have to resort to other APIs when enumerating the contents of a folder or performing search operations.

  • Trust and security, to help prevent the Outlook object model from being used as a means to propagate e-mail–based worms and viruses.

  • Forms, so that your application will be more flexible in customizing and deploying forms, and will support a richer and more contemporary user interface.

  • Innovation, so that you will be able to programmatically incorporate new Outlook features such as search, task flagging, category coloring, side-by-side calendars, and sharing through the Outlook object model.

Because the Outlook 2007 object model includes more than 85 new objects and the size of the object model has more than doubled, this article does not discuss every new object, but instead focuses on a handful of the most significant features. Other areas that deserve more in-depth discussion—such as Ribbon extensibility (also known as RibbonX), form regions, and security—are covered in other articles available on MSDN.

Enhancements and Additions to the Outlook Object Model

In earlier versions of Outlook, developers frequently had to resort to other APIs in order to complete their solutions. Outlook 2007 consolidates APIs such as CDO 1.21 and parts of Exchange Client Extensions and Extended MAPI into the Outlook object model. In order to accommodate this unification effort, the Outlook 2007 object model includes more than 85 new objects.

Why is this consolidation important to you as an Outlook developer? Your job as a developer is to implement the business logic of your solution according to specifications. You pay attention to other essential components such as performance, stability, and security. You look for a platform that lets you accomplish your development tasks in the most efficient and timely manner. Earlier versions of Outlook placed some road blocks in your path. The platform investments realized in Outlook 2007 will help make your job easier so that you can concentrate on a cleanly coded solution without spending large amounts of time on the difficulties of the Outlook object model. The consolidated Outlook object model will provide most of your Outlook development needs. The Outlook object model is fully supported for both native developers and managed-code developers. With the next version of Microsoft Visual Studio Tools for the Microsoft Office System (Visual Studio Tools for Office), you will have a complete development environment for creating professional solutions built on top of Outlook 2007.

The following tables list existing objects that have been enhanced with additional members, and new objects and collections that have been added to the object model. The majority of these objects and members already exist in the Beta 2 release of Outlook 2007; look in the object browser to confirm their existence.

Enhancements to Existing Objects

Table 1 lists enhancements to objects and collections that were available in earlier versions of Outlook. Only new methods, properties, and events are listed in the Enhancements column.

Table 1. Enhancements to Outlook objects and collections

Objects

Enhancements

AddressEntry object

Methods GetContact, GetExchangeDistributionList, GetExchangeUser

Properties AddressEntryUserType, PropertyAccessor

AddressList object

Methods GetContactsFolder

Properties AddressListType, IsInitialAddressList, PropertyAccessor, ResolutionOrder

Application object

Methods GetObjectReference

Properties Assistance, DefaultProfileName, IsTrusted, TimeZones

Events AttachmentContextMenuDisplay, BeforeFolderSharingDialog, ContextMenuClose, FolderContextMenuDisplay, ItemContextMenuDisplay, ItemLoad, ShortcutContextMenuDisplay, StoreContextMenuDisplay, ViewContextMenuDisplay

AppointmentItem object

Properties EndTimeZone, EndUTC, ForceUpdateToAllAttendees, GlobalAppointmentID, PropertyAccessor, SendUsingAccount, StartTimeZone, StartUTC

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

Attachment object

Properties BlockLevel, PropertyAccessor, Size

ContactItem object

Methods AddBusinessCardLogoPicture, ClearTaskFlag, ForwardAsBusinessCard, MarkAsTask, ResetBusinessCard, SaveBusinessCardImage, ShowBusinessCardEditor, ShowCheckPhoneDialog

Properties BusinessCardLayoutXML, BusinessCardType, IsMarkedAsTask, PropertyAccessor, ReminderOverrideDefault, ReminderPlaySound, ReminderSet, ReminderSoundFile, ReminderTime, TaskCompletedDate, TaskDueDate, TaskStartDate, TaskSubject, ToDoTaskOrdinal

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

DistListItem object

Methods ClearTaskFlag, MarkAsTask

Properties IsMarkedAsTask, PropertyAccessor, ReminderOverrideDefault, ReminderPlaySound, ReminderSet, ReminderSoundFile, ReminderTime, TaskCompletedDate, TaskDueDate, TaskStartDate, TaskSubject, ToDoTaskOrdinal

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

DocumentItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

Explorer object

Methods ClearSearch, Search

Properties NavigationPane

Folder object (This replaces the MAPIFolder object in earlier versions of Outlook. In all future applications, use the Folder object.)

Methods GetCalendarExporter, GetStorage, GetTable

Properties PropertyAccessor, Store, UserDefinedProperties

Events BeforeFolderMove, BeforeItemMove

Inspector object

Methods NewFormRegion, OpenFormRegion, SaveFormRegion

Events PageChange

JournalItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

MailItem object

Methods AddBusinessCard, ClearTaskFlag, MarkAsTask

Properties IsMarkedAsTask, PropertyAccessor, SendUsingAccount, TaskCompletedDate, TaskDueDate, TaskStartDate, TaskSubject, ToDoTaskOrdinal

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

MeetingItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

Namespace object

Methods CompareEntryIDs, CreateSharingItem, GetAddressEntryFromID, GetGlobalAddressList, GetSelectNamesDialog, GetStoreFromID, OpenSharedFolder, OpenSharedItem, SendAndReceive

Properties Accounts, AutoDiscoverXml, Categories, CurrentProfileName, DefaultStore, ExchangeMailboxServerName, ExchangeMailboxServerVersion, Stores

NoteItem object

Properties PropertyAccessor

PostItem object

Methods ClearTaskFlag, MarkAsTask

Properties IsMarkedAsTask, PropertyAccessor, ReminderOverrideDefault, ReminderPlaySound, ReminderSet, ReminderSoundFile, ReminderTime, TaskCompletedDate, TaskDueDate, TaskStartDate, TaskSubject, ToDoTaskOrdinal

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

Recipient object

Properties PropertyAccessor

RemoteItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

ReportItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

Search object

Methods GetTable

TaskItem object

Properties PropertyAccessor, SendUsingAccount, ToDoTaskOrdinal

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

TaskRequestAcceptItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

TaskRequestDeclineItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

TaskRequestItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

TaskRequestUpdateItem object

Properties PropertyAccessor

Events AttachmentRemove, BeforeAttachmentAdd, BeforeAttachmentPreview, BeforeAttachmentRead, BeforeAttachmentWriteToTempFile, BeforeAutoSave, Unload

View object

Properties Filter

New Objects and Collections

Table 2 lists the new objects, collections, and interfaces introduced in Outlook 2007. All object members are listed in the "Methods, Properties, and Events" column.

Table 2. New objects, collections, and interfaces introduced in Outlook 2007

Object, Collection, or Interface

Methods, Properties, and Events

Account object

Properties AccountType, Application, Class, DisplayName, Parent, Session, SmtpAddress, UserName

AccountRuleCondition object

Properties Account, Application, Class, ConditionType, Enabled, Parent, Session

Accounts collection

Methods Item

Properties Application, Class, Count, Parent, Session

AddressRuleCondition object

Properties Address, Application, Class, ConditionType, Enabled, Parent, Session

AssignToCategoryRuleAction object

Properties ActionType, Application, Categories, Class, Enabled, Parent, Session

AttachmentSelection object

Methods Item

Properties Application, Class, Count, Parent, Session

AutoFormatRule object

Properties Application, Class, Enabled, Filter, Font, Name, Parent, Session, Standard

AutoFormatRules collection

Methods Add, Insert, Item, Remove, RemoveAll, Save

Properties Application, Class, Count, Parent, Session

BusinessCardView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties Application, CardSize, Class, Filter, HeadingsFont, Language, LockUserChanges, Name, Parent, SaveOption, Session, SortFields, Standard, ViewType, XML

CalendarModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

CalendarSharing object

Methods ForwardAsICal, SaveAsICal

Properties Application, CalendarDetail, Class, EndDate, Folder, IncludeAttachments, IncludePrivateDetails, IncludeWholeCalendar, Parent, RestrictToWorkingHours, Session, StartDate

CalendarView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties Application, AutoFormatRules, BoldDatesWithItems, BoldSubjects, CalendarViewMode, Class, DaysInMultiDayMode, DayWeekFont, DayWeekTimeFont, DayWeekTimeScale, DisplayedDates, EndField, Filter, Language, LockUserChanges, MonthFont, MonthShowEndTime, Name, Parent, SaveOption, Session, Standard, StartField, ViewType, XML

CardView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties AllowInCellEditing, Application, AutoFormatRules, BodyFont, Class, Filter, HeadingsFont, Language, LockUserChanges, MultiLineFieldHeight, Name, Parent, SaveOption, Session, ShowEmptyFields, SortFields, Standard, ViewFields, ViewType, Width, XML

Categories collection

Methods Add, Item, Remove

Properties Application, Class, Count, Parent, Session

Category object

Properties Application, CategoryID, Class, Color, Name, Parent, Session, ShortcutKey

CategoryRuleCondition object

Properties Application, Categories, Class, ConditionType, Enabled, Parent, Session

Column object

Properties Application, Class, Name, Parent, Session

ColumnFormat object

Properties Align, Application, Class, FieldFormat, FieldType, Label, Parent, Session, Width

Columns collection

Methods Add, Item, Remove, RemoveAll

Properties Application, Class, Count, Parent, Session

ContactsModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

ExchangeDistributionList object

Methods Delete, Details, GetContact, GetExchangeDistributionList, GetExchangeDistributionListMembers, GetExchangeUser, GetFreeBusy, GetMemberOfList, GetMembers, GetOwners, Update

Properties Address, AddressEntryUserType, Alias, Application, Class, Comments, DisplayType, ID, Name, Parent, PrimarySmtpAddress, PropertyAccessor, Session, Type

ExchangeUser object

Methods Delete, Details, GetContact, GetDirectReports, GetExchangeDistributionList, GetExchangeUser, GetExchangeUserManager, GetFreeBusy, GetMemberOfList, Update

Properties Address, AddressEntryUserType, Alias, Application, AssistantName, BusinessTelephoneNumber, City, Class, Comments, CompanyName, Department, DisplayType, FirstName, ID, JobTitle, LastName, MobileTelephoneNumber, Name, OfficeLocation, Parent, PostalCode, PrimarySmtpAddress, PropertyAccessor, Session, StateOrProvince, StreetAddress, Type, YomiCompanyName, YomiDepartment, YomiDispayName, YomiFirstName, YomiLastName

FormNameRuleCondition object

Properties Application, Class, ConditionType, Enabled, FormName, Parent, Session

FormRegion object

Methods Reflow, Select, SetItemControlProperty

Properties Application, Class, Detail, DisplayName, EnableAutoLayout, Form, FormRegionMode, Inspector, InternalName, IsExpanded, Item, Language, Parent, Session, SuppressControlReplacement

Events Close, Expanded

FormRegionStartup interface

Methods BeforeFormRegionStartup, GetFormRegionStorage

FromRssFeedRuleCondition object

Properties Application, Class, ConditionType, Enabled, FromRssFeed, Parent, Session

IconView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties Application, Class, Filter, IconPlacement, IconViewType, Language, LockUserChanges, Name, Parent, SaveOption, Session, SortFields, Standard, ViewType, XML

ImportanceRuleCondition object

Properties Application, Class, ConditionType, Enabled, Importance, Parent, Session

JournalModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

MailModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

MarkAsTaskRuleAction object

Properties ActionType, Application, Class, Enabled, FlagTo, MarkInterval, Parent, Session

MoveOrCopyRuleAction object

Properties ActionType, Application, Class, Enabled, Folder, Parent, Session

NavigationFolder object

Properties Application, Class, DisplayName, Folder, IsRemovable, IsSelected, IsSideBySide, Parent, Position, Session

NavigationFolders collection

Methods Add, Item, Remove

Properties Application, Class, Count, Parent, Session

NavigationGroup object

Properties Application, Class, GroupType, Name, NavigationFolders, Parent, Position, Session

NavigationGroups collection

Methods Create, Delete, GetDefaultNavigationGroups, Item

Properties Application, Class, Count, Parent, Session

Events NavigationFolderAdd, NavigationFolderRemove, SelectedChange

NavigationModule object

Properties Application, Class, Name, NavigationModuleType, Parent, Position, Session, Visible

NavigationModules collection

Methods GetNavigationModule, Item

Properties Application, Class, Count, Parent, Session

NavigationPane object

Properties Application, Class, CurrentModule, DisplayedModuleCount, IsCollapsed, Modules, Parent, Session

Events ModuleSwitch

NewItemAlertRuleAction object

Properties ActionType, Application, Class, Enabled, Parent, Session, Text

NotesModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

OlkBusinessCardControl object

Properties MouseIcon, MousePointer

Events Click, DoubleClick, MouseDown, MouseMove, MouseUp

OlkCategory object

Properties AutoSize, BackColor, BackStyle, Enabled, ForeColor, MouseIcon, MousePointer, TextAlign

Events Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkCheckBox object

Properties Accelerator, Alignment, BackColor, BackStyle, Caption, Enabled, Font, ForeColor, MouseIcon, MousePointer, TripleState, Value, WordWrap

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkComboBox object

Methods AddItem, Clear, Copy, Cut, DropDown, GetItem, Paste, RemoveItem, SetItem

Properties AutoSize, AutoTab, AutoWordSelect, BackColor, BorderStyle, DragBehavior, Enabled, EnterFieldBehavior, Font, ForeColor, HideSelection, ListCount, ListIndex, Locked, MaxLength, MouseIcon, MousePointer, SelectionMargin, SelLength, SelStart, SelText, Style, Text, TextAlign, TopIndex, Value

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, DropButtonClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkCommandButton object

Properties Accelerator, AutoSize, Caption, Enabled, Font, MouseIcon, MousePointer, Picture, TextAlign, WordWrap

Events AfterUpdate, BeforeUpdate, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkContactPhoto object

Properties Enabled, MouseIcon, MousePointer

Events Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkDateControl object

Methods DropDown

Properties AutoSize, AutoWordSelect, BackColor, BackStyle, Date, DragBehavior, Enabled, EnterFieldBehavior, Font, ForeColor, HideSelection, Locked, MouseIcon, MousePointer, ShowNoneButton, Text, TextAlign, Value

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, DropButtonClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkFrameHeader object

Properties Alignment, Caption, Enabled, Font, ForeColor, MouseIcon, MousePointer

OlkInfoBar object

Properties MouseIcon, MousePointer

Events Click, DoubleClick, MouseDown, MouseMove, MouseUp

OlkLabel object

Properties Accelerator, AutoSize, BackColor, BackStyle, BorderStyle, Caption, Enabled, Font, ForeColor, MouseIcon, MousePointer, TextAlign, UseHeaderColor, WordWrap

Events Click, DoubleClick, MouseDown, MouseMove, MouseUp

OlkListBox object

Methods AddItem, Clear, Copy, GetItem, GetSelected, RemoveItem, SetItem, SetSelected

Properties BackColor, BorderStyle, Enabled, Font, ForeColor, ListCount, ListIndex, Locked, MatchEntry, MouseIcon, MousePointer, MultiSelect, Text, TextAlign, TopIndex, Value

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkOptionButton object

Properties Accelerator, Alignment, BackColor, BackStyle, Caption, Enabled, Font, ForeColor, GroupName, MouseIcon, MousePointer, Value, WordWrap

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkPageControl object

Properties Page

OlkSenderPhoto object

Properties Enabled, MouseIcon, MousePointer, PreferredHeight, PreferredWidth

Events Change, Click, DoubleClick, MouseDown, MouseMove, MouseUp

OlkTextBox object

Methods Clear, Copy, Cut, Paste

Properties AutoSize, AutoTab, AutoWordSelect, BackColor, BorderStyle, DragBehavior, Enabled, EnterFieldBehavior, EnterKeyBehavior, Font, ForeColor, HideSelection, IntegralHeight, Locked, MaxLength, MouseIcon, MousePointer, Multiline, PasswordChar, Scrollbars, SelectionMargin, SelLength, SelStart, SelText, TabKeyBehavior, Text, TextAlign, Value, WordWrap

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OlkTimeControl object

Methods DropDown

Properties AutoSize, AutoWordSelect, BackColor, BackStyle, Enabled, EnterFieldBehavior, Font, ForeColor, HideSelection, IntervalTime, Locked, MouseIcon, MousePointer, ReferenceTime, Style, Text, TextAlign, Time, Value

Events AfterUpdate, BeforeUpdate, Change, Click, DoubleClick, DropButtonClick, Enter, Exit, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp

OrderField object

Properties Application, Class, ColumnFormat, IsDescending, Parent, Session, ViewXMLSchemaName

OrderFields collection

Methods Add, Insert, Item, Remove, RemoveAll

Properties Application, Class, Count, Parent, Session

PlaySoundRuleAction object

Properties ActionType, Application, Class, Enabled, FilePath, Parent, Session

PropertyAccessor object

Methods BinaryToString, DeleteProperties, DeleteProperty, GetProperties, GetProperty, LocalTimeToUTC, SetProperties, SetProperty, StringToBinary, UTCToLocalTime

Properties Application, Class, Parent, Session

Row object

Methods BinaryToString, GetValues, Item, LocalTimeToUTC, UTCToLocalTime

Properties Application, Class, Parent, Session

Rule object

Methods Execute

Properties Actions, Application, Class, Conditions, Enabled, Exceptions, ExecutionOrder, IsLocalRule, Name, Parent, RuleType, Session

RuleAction object

Properties ActionType, Application, Class, Enabled, Parent, Session

RuleActions collection

Methods Item

Properties Application, AssignToCategory, CC, Class, ClearCategories, CopyToFolder, Count, Delete, DeletePermanently, DesktopAlert, Forward, ForwardAsAttachment, MarkAsTask, MoveToFolder, NewItemAlert, NotifyDelivery, NotifyRead, Parent, PlaySound, Redirect, Session, Stop

RuleCondition object

Properties Application, Class, ConditionType, Enabled, Parent, Session

RuleConditions collection

Methods Item

Properties Account, AnyCategory, Application, Body, BodyOrSubject, Category, CC, Class, Count, FormName, From, FromAnyRSSFeed, FromRssFeed, HasAttachment, Importance, MeetingInviteOrUpdate, MessageHeader, NotTo, OnlyToMe, OnLocalMachine, OnlyToMe, OnOtherMachine, Parent, RecipientAddress, SenderAddress, SenderInAddressList, SentTo, Session, Subject, ToMe, ToOrCc

Rules collection

Methods Create, Item, Remove, Save

Properties Application, Class, Count, IsRssRulesProcessingEnabled, Parent, Session

SelectNamesDialog object

Methods Display, SetDefaultDisplayMode

Properties AllowMultipleSelection, Application, BccLabel, Caption, CcLabel, Class, ForceResolution, InitialAddressList, NumberOfRecipientSelectors, Parent, Recipients, Session, ShowOnlyInitialAddressList, ToLabel

SenderInAddressListRuleCondition object

Properties AddressList, Application, Class, ConditionType, Enabled, Parent, Session

SendRuleAction object

Properties ActionType, Application, Class, Enabled, Parent, Recipients, Session

SharingItem object (only lists members that are added to or differ from the base class MailItem)

Methods Allow, Deny, Forward, OpenSharedFolder, Send

Properties AllowWriteAccess, BCC, CC, Class, MessageClass, Parent, RemoteID, RemoteName, RemotePath, RequestedFolder, SharingProvider, SharingProviderGUID, Type

StorageItem object

Methods Delete, Save

Properties Application, Attachments, Body, Class, CreateTime, Creator, EntryID, LastModificationTime, Parent, PropertyAccessor, Session, Size, Subject, UserProperties

Store object

Methods GetRootFolder, GetRules, GetSearchFolders, GetSpecialFolder

Properties Application, Class, DisplayName, ExchangeStoreType, FilePath, IsCachedExchange, IsDataFileStore, IsInstantSearchEnabled, IsOpen, Parent, PropertyAccessor, Session, StoreID

Stores collection

Methods Item

Properties Application, Class, Count, Parent, Session

Events BeforeStoreRemove, StoreAdd

Table object

Methods FindNextRow, FindRow, GetArray, GetNextRow, GetRowCount, MoveToStart, Restrict, Sort

Properties Application, Class, Columns, EndOfTable, Parent, Session

TableView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties AllowInCellEditing, Application, AutoFormatRules, AutomaticColumnSizing, AutomaticGrouping, AutoPreview, AutoPreviewFont, Class, ColumnFont, DefaultExpandCollapseSetting, Filter, GridLineStyle, GroupByFields, HideReadingPaneHeaderInfo, Language, LockUserChanges, MaxLinesInMultiLineView, Multiline, MultiLineWidth, Name, Parent, RowFont, SaveOption, Session, ShowItemsInGroups, ShowNewItemRow, ShowReadingPane, ShowUnreadAndFlaggedMessages, SortFields, Standard, ViewFields, ViewType, XML

TasksModule object

Properties Application, Class, Name, NavigationGroups, NavigationModuleType, Parent, Position, Session, Visible

TextRuleCondition object

Properties Application, Class, ConditionType, Enabled, Parent, Session, Text

TimelineView object

Methods Apply, Copy, Delete, GoToDate, Reset, Save

Properties Application, Class, DefaultExpandCollapseSetting, EndField, Filter, GroupByFields, ItemFont, Language, LockUserChanges, LowerScaleFont, MaxLabelWidth, Name, Parent, SaveOption, Session, ShowLabelWhenViewingByMonth, ShowWeekNumbers, Standard, StartField, TimelineViewMode, UpperScaleFont, ViewType, XML

TimeZone object

Properties Application, Bias, Class, DaylightBias, DaylightDate, DaylightDesignation, Index, Name, Parent, Session, StandardBias, StandardDate, StandardDesignation

TimeZones object

Methods ConvertTime, Item

Properties Application, Class, Count, CurrentTimeZone, Parent, Session

ToOrFromRuleCondition object

Properties Application, Class, ConditionType, Enabled, Parent, Recipients, Session

UserDefinedProperties object

Methods Add, Find, Item, Refresh, Remove

Properties Application, Class, Count, Parent, Session

UserDefinedProperty object

Methods Delete

Properties Application, Class, DisplayFormat, Formula, Parent, Session, Type

ViewField object

Properties Application, Class, ColumnFormat, Parent, PropertyName, Session

ViewFields collection

Methods Add, Insert, Item, Remove

Properties Application, Class, Count, Parent, Session

ViewFont object

Properties Application, Bold, Class, Color, Italic, Name, Parent, Session, Size, Strikethrough, Underline

What's New Add-Ins

This article is accompanied by add-ins that are available as a download. The add-ins are written in two versions with two languages: Microsoft Visual C# and Microsoft Visual Basic .NET. To run the add-ins, you will need Microsoft Visual Studio 2005 and Microsoft Office Outlook 2007 Beta 2 or later.

Part 2 of this article includes code samples from the What's New Add-Ins. The add-ins are a learning tool that will help you understand some of the important new features in the Outlook 2007 object model. Because there are far too many new areas in the object model to cover in one sample, the add-ins provide coverage of the following important new areas:

  • Context menu customization.

  • The Table object model and Instant Search queries.

  • The PropertyAccessor object, which allows getting or setting properties that are not explicitly exposed in the Outlook object model.

  • The Rules object model, which allows programmatically creating or accessing most rules supported by the Outlook Rules Wizard.

  • The SelectNamesDialog object, which displays the Outlook Address Book and lets you customize the dialog box caption and recipient selectors.

  • Enhancements to the AddressEntry and AddressList objects, including the ExchangeUser and ExchangeDistributionList objects, which allow getting and setting properties of an Exchange user or Exchange distribution list.

In addition to the What's New Add-Ins, other Outlook add-ins, including the Outlook 2007 Sample Add-ins: Rules Add-in, Travel Agency Add-in, and Prepare for Meeting Add-in, provide plenty of code examples to show you how various new features in the object model work together in an application.

NoteNote

If you are using Visual C# Express Edition or Visual Basic Express Edition to open the sample add-ins, you will not be able to build the setup/deployment project or install the sample add-ins.

Installation Instructions

  1. Download Outlook2007WhatsNewAddin.msi and save it on your hard disk.

  2. Double-click Outlook2007WhatsNewAddin.msi to start the Setup program.

  3. Follow the instructions on the screen to complete the installation.

    NoteNote

    Each sample solution is contained in a solution folder and subfolders. The suffix of the sample solution name identifies the language used for the sample. Visual Basic .NET samples have a "VB" suffix and C# samples have a "CS" suffix. For example, the folder WhatsNewAddinVB contains the Visual Basic .NET version, and the folder WhatsNewAddinCS contains the C# version.

Running the Sample Add-Ins

To run this sample:

  1. Close Outlook 2007.

  2. Open the SolutionName (WhatsNewAddinVB or WhatsNewAddinCS) solution in the My Documents\Visual Studio 2005\Projects\SolutionName folder.

  3. In Solution Explorer, select SolutionName Setup.

  4. On the Build menu, select Build SolutionName Setup.

  5. When the build process is complete, open the Project menu, and then click Installto install the solution.

  6. Start Outlook to start the add-in in Run mode or press F5 to start the add-in in Debug mode.

    If Outlook does not open in Debug mode, open Solution Explorer and select SolutionName. Then on the Project menu, select SolutionNameProperties, select the Debug tab, and then under Start Action, select the Start External Program option. Click the ellipsis (...) button, and then select Outlook.exe in the following folder:

    Drive:\Program Files\Microsoft Office\Office12

Form Regions

Form regions enable you to customize both built-in and custom items in ways that were impossible in earlier versions of Outlook. From a user-interface perspective, form regions are the most important and exciting new addition to the Outlook extensibility platform. Form regions let you add a custom user interface to a standard Outlook form that can be displayed in an Inspector or in the Reading Pane. In earlier versions of Outlook, customizing the Reading Pane or adding user-interface features to standard Outlook forms was difficult or impossible. Outlook 2007 form regions seek to correct those past limitations. An in-depth discussion of form regions is beyond the scope of this article, but you can find more information in the Outlook Developer Reference.

Here is a quick guide to what you can do with form regions:

  • Customize standard Outlook forms or create new forms for derived message classes.

  • Display your form region in an Inspector or Reading Pane.

  • Use new Outlook 2007 controls in form regions. All controls in a form region are themed with Microsoft Windows and have an updated look. Outlook 2007 controls also support a full range of control events such as MouseUp, MouseDown, and KeyPress. Outlook 2007 includes the following:

    • Date and time controls

    • Page control, which includes scheduling and tracking pages for an appointment item

    • Electronic Business Card control

    • Contact and sender photo controls

    • Category control

    • Check box, combo box, command button, label, list box, option button, and text box controls

    • InfoBar control

Travel Agency Sample Add-in

Just to start you thinking about form regions, Figures 1 and 2 illustrate their power and versatility. These screen shots are from the Travel Agency Add-in, which is available on the Microsoft Download Center. Its overall scenario is that a travel agent stores itineraries in individual contact items. These itineraries are stored as a hidden attachment (containing XML representation of itineraries) on the contact item. Itineraries are thus available both online and offline and will roam with the user.

Figure 1. Contoso Travel Information is an adjoining form region that displays in the Reading Pane or in an Inspector

Contoso Information is an adjoining form region

Figure 1 shows an adjoining form region in the Reading Pane. Adjoining form regions can display in an Outlook Inspector or in the Reading Pane in the Outlook Explorer window. In this case, the form region appears only when a received message is selected in a view. The Contoso Travel Information adjoining form region is registered for items where the message class is IPM.Note. If you do not want to display the adjoining form region or specific message because the sender of the message is not in your Contacts folder, then you can programmatically hide or show the form region as needed.

Figure 2. A separate form region displays travel itineraries for a given contact

Separate form region displays travel itineraries

Figure 2 shows the Itineraries page on the standard Outlook contact form. Unlike custom forms in earlier versions of Outlook, you can associate a form region with any Outlook standard forms such as Message, Appointment, or Contact. You can also use the form region for custom forms for derived message classes, such as IPM.Contact.TravelAgency. With the Travel Agency Add-in, the form region is registered for the default contact item, IPM.Contact.

Notice that you can also associate a custom icon with your separate form region. If you include the icon in your form region XML, your custom icon is displayed automatically in the Show group of the Ribbon and lets the user navigate to the separate form region.

The other important feature of form regions that you can see in Figure 2 is the use of an Electronic Business Card control. This control is just dropped into the form region at design time. You do not have to do anything to ensure that the control is populated with the correct contact information. Unlike custom forms in earlier versions of Outlook, form regions make your customizations appear to be an integral component of the Outlook user interface.

FormRegionStartup Interface

In order to create a form region, you must implement the FormRegionStartup interface in your add-in. FormRegionStartup is an interface that allows an add-in to specify the storage and the user interface of a form region, obtains an object for that form region, and determines when the form region is about to be displayed in a form or in the Reading Pane. The FormRegionStartup object is an abstract class, which means that it cannot be instantiated directly.

An add-in deploying a form region in an Outlook form on a client computer must implement the FormRegionStartup interface, which consists of the methods BeforeFormRegionShow and GetFormRegionStorage. When Outlook loads the add-in, Outlook queries the IDTExtensibility2 interface for FormRegionStartup.

The add-in indicates the storage and layout file for the form region in GetFormRegionStorage. When GetFormRegionStorage is called, Outlook allocates storage and calculates the layout for the form region, instantiates an object for the form region, and returns a value representing the storage allocated to the add-in. If GetFormRegionStorage is successful, just before the form region is displayed in an Inspector window or in the Reading Pane, Outlook calls BeforeFormRegionShow and passes the FormRegion object of the form region to the add-in. The add-in should use this opportunity, before the form region is displayed, to update controls in the form region or set the visibility of the form region.

When the add-in closes the frame for the form region, the add-in must release the object for the form region.

For examples of add-ins in C# and Visual Basic .NET that implement FormRegionStartup, see Building an Outlook 2007 Form Region with a Managed Add-In.

Security

Outlook 2007 introduces an important change in the way that the Outlook object model guard operates. Whereas the behavior of the object model guard has not changed significantly for Outlook add-ins, Outlook 2007 allows external applications to run without object model guard prompts—provided that the computer on which your code is running has functional antivirus software installed and that all antivirus definitions are current.

This change represents a major departure from the way the object model guard worked in earlier versions for external out-of-process COM callers. Before Outlook 2007, external COM callers were always untrusted from the perspective of the object model guard. This means that external applications had to resort to extended MAPI or third-party libraries in order to prevent the display of Outlook 2007 object model guard warnings, such as the one shown in Figure 3.

Figure 3. Outlook Address Book warning

Outlook Address Book warning

The object model guard was originally introduced for Microsoft Outlook 98 and Microsoft Outlook 2000. Since the introduction of the object model guard, the frequency of the Address Book warning often frustrated developers for legitimate external COM applications and their users. Also, if you needed to use CDO for MAPI property access or improved performance, you faced a different security model that did not integrate with the Outlook add-in trust model. For most applications, Outlook 2007 has removed the need for CDO. Outlook 2007 offers improved security that aims at removing development road blocks for all legitimate Outlook developers. The following sections describe the operation of the Outlook object model guard in Outlook 2007.

Add-Ins and the Outlook Object Model Guard

For add-ins, the behavior has not changed significantly from Microsoft Office Outlook 2003. The introduction of Group Policy Objects (GPO) to store non-default security settings is new to Outlook 2007. The following list describes the behavior of add-ins and the Outlook object model guard:

  • All add-ins are trusted by default. This means that when Outlook uses its default setting, the Application object passed in the OnConnection event of your add-in has trusted access to the Outlook object model. If you are writing an add-in using Visual Studio Tools for Office, the built-in Application object is also trusted. All objects that derive from the trusted Application object are also trusted. Be aware that if you try to create an Outlook Application object that does not derive from the trusted Application object, that object and any objects that derive from that object are not trusted by the object model guard.

  • In corporate settings where users are connected to a Microsoft Exchange server, IT administrators can modify the AdminSecurityMode key on a client computer to cause Outlook to trust only a list of specified add-ins and to obey non-default settings for the object model guard.

  • If the AdminSecurityMode key is set, one of the following actions occurs:

    • Outlook checks the Outlook security form in an Exchange public folder to trust specific add-ins and observes specific object model guard settings.

    • Outlook checks GPOs to trust specific add-ins and observes specific object model guard settings.

Out-of-Process Callers and the Outlook Object Model Guard

For out-of-process callers, the behavior has changed significantly from Outlook 2003. If antivirus software has been installed and is up to date on the client computer, Outlook will not display object model guard warning dialog boxes when you call protected members such as MailItem.Send or MailItem.Recipients.

All out-of-process COM callers and add-ins run without security prompts under the following conditions:

  • The client computer is running Microsoft Windows XP SP2 or Windows Vista and the Windows Security Center indicates that the antivirus software is in a "Good" health status. If the computer is joined to a domain, this health status indicator might not be visible but is still maintained.

  • The installed antivirus software is designed for Windows XP SP2 or Windows Vista.

  • Outlook is configured in one of the following ways:

    • Uses the default security settings

    • Uses group policy–defined security settings that are set to warn when no antivirus software is detected

    • Uses group policy–defined security settings that do not have programmatic access policy applied

Additionally, Outlook suppresses the prompts when it is configured to Never warn me about suspicious activity (not recommended) through the Trust Center dialog box shown in Figure 4.

Figure 4. Control programmatic access using the Outlook Trust Center

Control programmatic access using the Trust Center

These conditions are checked each time Outlook starts. Additionally, Outlook uses change notifications to check for changes to antivirus settings. If changes are detected that take the computer out of the safety zone defined previously, the object model guard prompts are enabled and the system is not considered trusted until the situation is fixed. If Outlook detects changes indicating that these conditions are satisfied again, object model guard prompts are not displayed.

Administrators can enable the object model warning dialog feature or disable object model access to protected object model members by using the Outlook security GPOs or the Outlook security form in an Exchange public folder.

For complete details about Outlook 2007 object model security, see Code Security Changes in Outlook 2007.

Conclusion

This article, which is the first in a two-part series, provides a top-level view of the enhancements and additions for developers in Microsoft Office Outlook 2007. For more information about the enhanced Outlook object model, see Part 2: What's New for Developers in Outlook 2007 (Part 2 of 2).

Additional Resources