Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   C# ItemProperties not getting saved (http://www.outlookbanter.com/add-ins-outlook/53113-c-itemproperties-not-getting-saved.html)

Kulvinder July 23rd 07 01:28 PM

C# ItemProperties not getting saved
 
Hi,

I am trying to insert an Itemproperty in the Outlook Appointment item as
follows :

Outlook.ItemProperty olItemProperty = _olEvent.ItemProperties["MyKey"];

//create new property if the same doesn't exists
if (olItemProperty == null)
{
olItemProperty = _olEvent.ItemProperties.Add("MyKey"),
Microsoft.Office.Interop.Outlook.OlUserPropertyTyp e.olText, false, null);
}

Actually, the problem is that when i save the appointment, the ItemProperty
i added doesnt remain in the Item. It seems to get lost. Can anyone tell me
what could be the reason ?

I posted the same a Microsoft VSTO blogs where Sue Mosher told me that as
per "Ken Slovak", the item must be passed as using "ref" keyword. Why ?

Ken,
Can you please reply on this ? The same code is working on the other
machines i have. Is there any way to debug this problem ?

Regards
Kulvinder Singh

Ken Slovak - [MVP - Outlook] July 23rd 07 02:35 PM

C# ItemProperties not getting saved
 
I didn't say it "must" use ref, I suggested that might be the problem. If
it's not the problem disregard the suggestion.

If using both ItemProperties and UserProperties fail on only one machine I'd
suggest trying to find out what's different about that one machine. If the
problem is limited then it's obviously not a general problem with your code
but a problem specific to that one machine and no one here will be able to
help with that most likely.

I'd suggest seeing what's different about that machine such as
Office/Outlook version and level, any other addins that might be installed
there, configuration settings on that machine. You can see if a new profile
solves the problem, or if there's corruption in the PST or OST using ScanPST
or ScanOST, if a new PST or OST helps or if an Office repair helps.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Kulvinder" wrote in message
...
Hi,

I am trying to insert an Itemproperty in the Outlook Appointment item as
follows :

Outlook.ItemProperty olItemProperty = _olEvent.ItemProperties["MyKey"];

//create new property if the same doesn't exists
if (olItemProperty == null)
{
olItemProperty = _olEvent.ItemProperties.Add("MyKey"),
Microsoft.Office.Interop.Outlook.OlUserPropertyTyp e.olText, false, null);
}

Actually, the problem is that when i save the appointment, the
ItemProperty
i added doesnt remain in the Item. It seems to get lost. Can anyone tell
me
what could be the reason ?

I posted the same a Microsoft VSTO blogs where Sue Mosher told me that as
per "Ken Slovak", the item must be passed as using "ref" keyword. Why ?

Ken,
Can you please reply on this ? The same code is working on the other
machines i have. Is there any way to debug this problem ?

Regards
Kulvinder Singh



Kelmen[_2_] August 7th 07 08:24 AM

C# ItemProperties not getting saved
 
http://groups.google.com/group/micro...c22fdab1303098

I have the same problem, but found the above link helped.

call the item .Save() method.


All times are GMT +1. The time now is 03:47 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com