Article ID: 907985 - Last Review: November 22, 2007 - Revision: 4.3 Changes to custom properties in OutlookOn This PageSUMMARYTo guarantee consistent use of custom properties, or fields, Microsoft Office Outlook 2003 Service Pack 2 (SP2) and later versions of Outlook limit some of the ways that custom properties can be introduced into Outlook data stores. For example, custom properties can be introduced in specific ways in Outlook personal folders (.pst) files. INTRODUCTIONThis article does the following:
MORE INFORMATIONAbout custom propertiesCustom properties are used by e-mail programs, such as Outlook, to add more information to a message. Typically, this additional information is used by an e-mail program for a specific purpose. However, there are other ways that custom properties can be used. For example, custom properties can be added to messages or items if you use Outlook custom forms and those forms contain custom fields. Custom properties are frequently used to add more information for tracking purposes. Custom properties are also used to add data that a user does not have to see. A custom solution can also add custom properties to regular items. A custom solution programmatically adds custom properties to a message or item without requiring a custom form.Custom properties can be persisted in the .msg file format and the .oft file format in Outlook. Additionally, custom properties can be persisted to e-mail messages that are sent over the Internet if the sender uses the Send using Outlook Rich Text Format option. This option encapsulates the MAPI section of the message in Transport Neutral Encapsulation Format (TNEF), and then the TNEF is decoded when the message is received. A sender can send an e-mail that has custom properties in the following scenarios:
http://msdn2.microsoft.com/en-us/library/ms529055.aspx
(http://msdn2.microsoft.com/en-us/library/ms529055.aspx)
Note In an Exchange environment, the term "store" as used in this article refers to a whole mailbox store (database). The term does not refer to an individual user's mailbox store. There may be one or more Exchange mailbox databases in an organization.Behavior changes in OutlookThe implementation of MAPI in Outlook has been changed to control how custom properties can be created. To guarantee consistent use of custom properties, custom properties must already be used in the organization or on the Outlook client. As soon as custom properties are being used or are registered, the custom properties can be freely transmitted to other Outlook clients or to servers that are running Exchange Server. The custom properties can also be sent over the Internet.E-mail messages are typically sent in MIME format over the Internet. When Outlook receives an Internet e-mail message, the message is converted into a MAPI representation. The following are examples of Internet e-mail protocols:
Note Messages that contain custom properties that are sent in an Exchange organization are not affected by these changes. Custom properties can also be saved in .msg files and in .oft files. If a user opens a .msg file that has custom properties, those custom properties are not saved to the default store when the message is saved, forwarded, and so on. Typically, .oft files are used to back up Outlook custom forms. With .oft files, the new behavior applies to all kinds of items. The custom form will not open. Instead, the message will appear in the default form for that particular item type. In summary, this change in design can cause two things to occur:
Best practices and other ways to create new propertiesThere are a variety of ways that you can design and develop custom solutions. Some of these approaches are considered best practices. Other approaches may also work, but we do not recommend those approaches for one or more reasons.Best practice: Add custom fields programmaticallyVarious APIs can be used to programmatically add custom fields to items. To do this, use the UserProperties.Add method in the Outlook object library ("Outlook.Application"). The following code illustrates this best practice.http://msdn2.microsoft.com/en-us/library/ms527518.aspx
(http://msdn2.microsoft.com/en-us/library/ms527518.aspx)
For C++ developers, Extended MAPI can used to add named properties. For more information, visit the following MSDN Web site:http://msdn2.microsoft.com/en-us/library/ms529684.aspx
(http://msdn2.microsoft.com/en-us/library/ms529684.aspx)
Best practice: Use published custom forms that contain custom fieldsOutlook largely trusts published custom forms. However, Outlook does not trust unpublished forms or one-off forms. This includes .oft files. Therefore, when you design a custom form solution, we strongly recommend that you publish the custom form. You should design the form so that the form does not become a one-off form. As long as a form is published, the form will not be affected by the change in Outlook.For more information about one-off forms and how one-off forms can be unintentionally created, click the following article number to view the article in the Microsoft Knowledge Base: 290657
(http://support.microsoft.com/kb/290657/
)
Description of form definitions and one-off forms in Outlook 2002
When you publish an .oft file to a different store, the default store lets you create properties in that store. Additionally, when you create a custom form that has custom properties and you publish it to the appropriate forms library or folder, the custom properties are created in the affected stores. Best practice: Programmatically deploying custom formsIf you are developing an Outlook custom form that will be used by others, there are few approaches you can use. The approach that you use depends on several factors. These factors include the type of form, who will use the form, where the form will be used, and so on. Typically, if a custom form will be used by many people, we recommend that you publish the form in the Organizational Forms Library. However, if that is not possible, you may want to publish the form in a shared folder or in the Personal Forms Library of some users. You can programmatically install a custom form by using the CreateItemFromTemplate method in the Outlook object library. You use the CreateItemFromTemplate method to open an .oft file, and then publish the form by using the PublishForm method. In this case, an .oft file is not affected by the custom properties changes.Not recommended: Deploy or send .oft files for users to openYou can save Outlook custom forms as .oft files. These forms can contain custom fields, user-interface changes, and custom Microsoft Visual Basic Scripting Edition (VBScript) code to add functionality to the form. Although Outlook already contains features that prevent the VBScript code in .oft files from running, Outlook now also restricts the use of .oft files. If an .oft file contains custom properties and the user has not previously used those custom properties, the custom properties are not in the user's default store. Outlook will not render the custom form when the user double-clicks the file. However, to have Outlook open a custom form that is stored as an .oft file, click File, click New, and then click Choose Form. You can then change the location to User Templates in File System, and then click Browse to open the .oft file. The form will open, and you can save the custom properties to the default store.Not recommended: Use the AllowNamedProps registry keySome organizations may have valid reasons to have certain custom properties available throughout the organization. If multiple stores are used, you may want to make sure that a set of custom properties can be added to all stores. Therefore, Outlook 2003 SP2 and later versions support client-side registry keys that specify which custom properties can be created. To specify which custom properties should be enabled, custom properties are defined under the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Outlook\AllowedNamedProps\Note In this registry key, <version> is a placeholder for the version of Outlook that you are using. For Outlook 2003, the version number is 11.0. For Outlook 2007, the version number is 12.0. The version number will increase in later versions of Outlook. The overall registry key structure for an entry in the registry is: <GUID> <Property Name>
The following placeholders are used in the registry key structure: "Kind" (dword)
"ID" (dword) "Type" (dword)
Collapse this table
Name: “MyStringFieldName1”
The following is an example of how to set a named-by-ID property: Type: PT_LONG [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\AllowedNamedProps\{00020329-0000-0000-C000-000000000046}\MyStringFieldName1]
"Type"=dword:00000003
ID: 0x0330
Type: PT_LONG [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\AllowedNamedProps\{00020329-0000-0000-C000-000000000046}\MyMAPIProp1]
"Kind"=dword:00000000
"ID"=dword:00000330
"Type"=dword:00000003
For these two examples, the registry appears similar to the following in Registry Editor: {00020329-0000-0000-C000-000000000046} MyStringFieldName1
Type = 3 MyStringFieldName2 Type = 3 {00020329-0000-0000-C000-000000000046} MyMAPIProp1 Kind = 0 ID = 330 Type = 3 MyMAPIProp2 Kind = 0 ID = 331 Type = 3 Not recommended: Re-enable the ability to create propertiesThree registry keys can be deployed to client computers to disable the blocking of custom properties and revert Outlook to its previous behavior. These registry keys are supported by group policies. The following registry keys can revert Outlook 2003 to its previous behavior:Note The following registry keys do not revert Outlook 2007 to its previous behavior.
| Article Translations
|
Back to the top
