Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a custom Outlook Item?

I understand that Outlook has set items, i.e. Mail, Task, Calendar, Notes, etcetera. How can you create a custom Item that Outlook will recognize as the others? I know that when you add the Business Contact Manager it creates Items like "Opportunities"

Can you override an Item, or inherit an Item and alter/add properties and methods?

examples:

olAppointmentItem           1         Represents an AppointmentItem 
olContactItem               2         Represents a ContactItem 
olDistributionListItem      7         Represents an DistListItem 
olJournalItem               4         Represents a JournalItem 
olMailItem                  0         Represents a MailItem 
olNoteItem                  5         Represents a NoteItem 
olPostItem                  6         Represents a PostItem 
olTaskItem                  3         Represents a TaskItem 
like image 262
Chris Hayes Avatar asked Mar 01 '23 18:03

Chris Hayes


1 Answers

You cannot create new "types"; but you can certainly re-use the existing types by adding your own properties.

That comment is not correct. you can certainly use custom forms, you just need to publish them first to a forms library, and make them accesible to users. generally they are based on the design of one of the default item types, and can also be associated with a folder as the default item type.

Edit: (updating post as per comment request)

A.Create and publish a custom form - http://office.microsoft.com/en-au/outlook/HA012106101033.aspx

B. programmatically create an instance of the custom form.

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);
like image 102
Anonymous Type Avatar answered Mar 07 '23 05:03

Anonymous Type