Add items into a calendar (Outlook 2007)

J

j

In Outlok 2007 it's possible to add any item (regular mail) to
calendar by right clicking on mail item's flag icon and setting and
setting folow up (Today, Tomorrow .... Custom).



My question is , how can i do the same programatically (.NET, C#, +
Redemption).

Which named properties i should add to item ???







Tnx in advance.
 
K

Ken Slovak - [MVP - Outlook]

That doesn't add things to the calendar, it adds a bunch of task related
properties to the items and the items then show up in the To-Do Bar list.

The easiest way to mimic that is to examine an unflagged item with a MAPI
viewer and look at the item properties. Then flag it and re-examine the item
and see what properties were added to the item. With those properties the
item will show up in the hidden search folder that forms the basis for the
To-Do Bar.

You can download MFCMAPI free from MS (a MAPI viewer) or use a commercial
MAPI viewer like OutlookSpy (www.dimastr.com), my own choice.
 
S

Sue Mosher [MVP-Outlook]

You don't need Redemption for that. From the Outlook object model, you can call the MailItem.MarkAsTask method and set the TaskStartDate and TaskStartDate properties, etc. appropriately.
 
J

j

Thanks for replays,

I can't use MailItem.MarkAsTask, cause my AddIn written for Office
2003 (VSTO 2005) and i can't find such property, i guess it's
only for Office 2007 (VSTO 2007).

Any suggestions???
 
K

Ken Slovak - [MVP - Outlook]

For Outlook 2003 manually add those task properties that MarkAsTask() does.
For Outlook 2007 use reflection to call that method. Or manually add the
properties in both versions. Use a MAPI viewer to see what properties are
added in Outlook 2007 when that method is called, either by test code or
from the UI.
 
J

j

Thanks.

I used Outlook SPY viewer to see what properties are changed or added
in OL 2007, but didn't find anything special,
a lot of properties changed, and a some properties added. Trying to
add some porperties and change existing dosn't result my vishes.


Any sugegstions???
 
K

Ken Slovak - [MVP - Outlook]

I don't know what you're looking at but I see reminder and task properties
added to the item. Among them are StartDate, DueDate, Complete, Status,
ReminderSet, FlagDueBy and ReminderTime.

When those properties are added I see the item in the To-Do Bar. Isn't that
what you said you wanted?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top