Help!

C# ItemProperties not getting saved


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Add-Ins RSS
Next:  Operation aborted (Exception from HRESULT: 0x8000..  
Author Message
Kulvinder
External


Since: May 28, 2007
Posts: 7



PostPosted: Mon Jul 23, 2007 5:28 am    Post subject: C# ItemProperties not getting saved
Archived from groups: microsoft>public>outlook>program_addins (more info?)

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.OlUserPropertyType.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
Back to top
Ken Slovak - [MVP - Outlo
External


Since: Oct 17, 2003
Posts: 3213



PostPosted: Mon Jul 23, 2007 9:35 am    Post subject: Re: C# ItemProperties not getting saved [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <Kulvinder.RemoveThis@discussions.microsoft.com> wrote in message
news:3EDF5762-811D-4EED-8A99-3ABBBC28E678@microsoft.com...
> 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.OlUserPropertyType.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
Back to top
Kelmen
External


Since: Aug 07, 2007
Posts: 1



PostPosted: Tue Aug 07, 2007 12:24 am    Post subject: RE: C# ItemProperties not getting saved [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

http://groups.google.com/group/microsoft.public.outlook.program_addins...owse_th

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

call the item .Save() method.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Add-Ins All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum