views:

1143

answers:

2

I am using VSTO 3.0 for outlook2003 addin. Is it possible to create an item with custom Message Class IPM.CustomClass.

The following article mentions about form configuration files to create custom item IPM.Help. Is it possible to create a custom Outlook Form and register it against custom message class.

BTW it is possible to create an item with custom Message Class IPM.CustomClass in Exchange server 2003 using webdav.

A: 

Yes you can create a new item of a custom class use Items.Add Method and specify the Message Class.

http://msdn.microsoft.com/en-us/library/bb220348.aspx

But is that your question ? as It looks like that you may want to But is that your question ? as It looks like that you may want to programmatically create a new class ?

76mel
The custom Message class should not be extending an existing item such as IPM.Contact or IPM.Task.. It should be IPM.CustomMessage
Deepak N
Sorry I don't understand. If your class IPM.CustomMessage is already registed on the system then you should be able to add it to and items collection.
76mel
A: 

Yes you can create message classes in Exchange. You use the organsisational forms library. I believe you can do this with webdav if you need to, essentially you still design the form in outlook and save it. Then use webdav to push the form template to the org library of exchange. http://www.outlookcode.com/article.aspx?ID=35

Yes you can create a custom message class. as previous poster said, you just create a form in outlook (in design mode) and then use the Publish command to publish the form to the outlook forms library (or organisational forms library - exchange).

http://office.microsoft.com/en-au/outlook/HA012106101033.aspx

In terms of VSTO you don't use this to directly register the class, this is done for you when you use the Publish command from the forms designer. VSTO is just used to write the code that creates the Inspector window using your custom message class.

http://support.microsoft.com/kb/310244

see code example below..

Outlook.Application olApp = new Outlook.Application();
//mapifolder for earlier versions (such as ol 2003)
Outlook.Folder contacts = olApp.Session.GetDefaultFolder(Outlook.olDefaultFolders.olFolderContacts);
//must start with IPM.   & must be derived from a base item type, in this case contactItem.
Outlook.ContactItem itm = (Outlook.ContactItem)contacts.Items.Add(@"IPM.Contact.CustomMessageClass");
itm.Display(false);
Anonymous Type