New Outlook Documentation Part 5 - One-Off Forms

This should help dealing with scenarios in Outlook that cause forms to become one-offed.

TopicHow to remove one-off form attributes from a message which has unexpectedly been “one-offed”.

One-Off FormsA message which has been “one-offed” is one where a custom form definition has been saved with the message. While there are legitimate scenarios for one-offing a form, typically this happens unexpectedly. The negative side effects and descriptions of how messages can become one-offed are discussed in the following Knowledge Base article: http://support.microsoft.com/kb/207896

Removing One-Off PropertiesA message which has been marked as a one-off can be restored to a regular message by deleting a set of named properties and removing some flags from another named property. This process can be done with Extended MAPI or CDO. The properties which must be deleted are all in the PSETID_Common namespace and are dispidFormStorage, dispidPageDirStream, dispidFormPropStream, and dispidScriptStream. The property which must be modified is also in the PSETID_Common namespace. The flags INSP_ONEOFFFLAGS must be removed from dispidCustomFlag.

In addition, the property dispidPropDefStream in the PSETID_Common namespace may also be removed. If this property is removed, then the flag INSP_PROPDEFINITION should be removed from dispidCustomFlag. A side effect of removing this property is that the Outlook Object Model and the Outlook User Interface will no longer be able to access user properties which have been set on the item. These properties and their values will still be accessible through MAPI. Note that if this property is not removed and the items is one-offed again, it is possible that the property can be overwritten with new data.

Form One-offs are a major headache and in practice appears to rarely be the desired behavior - is there some major technical roadblock from allowing developers to completely short-curcuit the creation of one-offs?

It would be interesting to be enlightened as to the details of the original decision to add the current form one-off behavior and why it persists to this day.

Jeff

14 Jun 2007 10:42 PM

Hello. I'm new to the Outlook programming and I have headaches on the one-off forms. If I were to reopen the previously saved item, the item becomes one-off, am I right? Can you teach me what I have to do if I need to run the code on the previously saved item? I have done everything done almost everything that prevents the item to go one-off but still can't work. My email is natur3_dr3am3rz@hotmail.com Thanks in advance.

Gosaca - I can’t speak for the original designers of the Outlook form features, but my understanding is that the initial design was based on the assumption that when a developer made a change to the form definition they wanted that change to stick -for example adding a new user-defined field to the item and being able to reference that field later. Back in the Outlook 97/98/2000 days one-offs weren't as big of a headache because users would still be prompted to run the VBScript code in a one-off item (via the Enable/Disable Macro dialog). Although one-offs still weren't very desirable by most form developers, some intentionally designed one-off forms with the assumption that users would be able to click Enable on the Enable/Disable macro button. This was fairly common with form solutions distributed in the .oft (Outlook Template) file format. Since the Outlook Object Model Security features released around the Outlook 2000 SR1 timeframe security has been improved, but one-off forms have been less and less useful due to the default blocking VBScript and non-default ActiveX controls. Now, one-offs are pretty much a headache for most form developers. There is always risk in trying to make a significant change to the architecture of a developer feature especially when developers have depended on it working a specific way for several years. It is not easy to predict all of the consequences of making a change. The good news is that most of the time one-off behavior can be avoided, and going forward the new Outlook 2007 Form Regions feature provides a more robust solution, especially if multiple developers from other companies need to customize the same item. I hope this helps add some perspective.

Here are some suggestions to help identify and eliminate the cause of one-off behavior when working with

Glenn

2 Dec 2009 8:13 PM

I have a problem where all my recuring tasks no longer function. I dabled with a custom form and used it for a while instead of tasks. I then decided I didn't like it so reset msgclass back to default task form. however all my tasks still look like the original form. (i.e. I must have saved the definition). Now I can't undo anything. My standard tasks still work but the recurring ones no longer allow me to make changes or complete etc. I am not a programmer so have no idea how to apply what you have raised in this blog. Someone please develop a generic tool to help us non programmers recover our system.