James Samuel Samuel
Posts: 26
Joined: 2010-05-18
|
Sir,
I am doing an add-in project in OUTLOOK, I need to add a button in mail item grid just like the 'flag' ... |
|
Andrei Smolin
Add-in Express team
Posts: 17498
Joined: 2006-05-11
|
|
James Samuel Samuel
Posts: 26
Joined: 2010-05-18
|
Sir,
I have used the following code to generate user property for my mail.... there is no exception onthis code.. But i didn't see the userproperty that created by me... help me sir...
using OutLook = Microsoft.Office.Interop.Outlook;
private void AddinModule_AddinStartupComplete(object sender, EventArgs e)
{
OutLook._Application outlookobj3 = new OutLook.Application();
OutLook.MAPIFolder mapiF = (OutLook.MAPIFolder)outlookobj3.Session.Folders["Test"];
OutLook.MAPIFolder mapiF2 = (OutLook.MAPIFolder)mapiF.Folders["inbox"];
OutLook.MailItem newMItem = (OutLook.MailItem)outlookobj3.CreateItem(OutLook.OlItemType.olMailItem);
newMItem.Subject = "Testing mail";
newMItem.Body = "Body of the mail";
newMItem.To = "to@gmail.com";
newMItem.UserProperties.Add("Property", OutLook.OlUserPropertyType.olYesNo,true,Missing.Value) ;
newMItem.ItemProperties["Property"].Value = true;
newMItem.Save();
newMItem.Move(mapiF2);
} |
|
Andrei Smolin
Add-in Express team
Posts: 17498
Joined: 2006-05-11
|
Hello James,
That UserProperty is added to the list of fields available for that folder. But you need to add that column to the view, in Outlook 2007 see View | Current View | Customize Current View | Fields | "Select available fields from:" User-defined fields in folder. To add that column to the view programmatically, you need to study View.XML before and after adding that column in the UI.
Also, see Creating Custom Views and View.XML Property.
Regards from Belarus (GMT+2),
Andrei Smolin
Add-in Express Team Leader |
|