Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > WinForms/Console Application Design
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the WinForms/Console Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2009, 01:59 AM
Authorized User
 
Join Date: Dec 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn
Default Can't save outlook appointment user properties

Hi All,

I am creating outlook appoinments from my windows application. I am adding one
user property for each appoinment so that I can retrieve that appoinment later with the unique property value I added.

Outlook.Application outlookApp = new Outlook.Application();
Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookApp.CreateItem(Out look.OlItemType.olAppointmentItem);

oAppointment.UserProperties.Add("Key", OlUserPropertyType.olText, true, Missing.Value);
oAppointment.UserProperties["Key"].Value = some randomly generated unique value.
oAppointment.Save();

After saving the appoinment, I am trying to retrieve the appoinment based on the user property I added.

Outlook.NameSpace oNS = outlookApp.GetNamespace("MAPI");
Outlook.MAPIFolder oCalendar = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar);
Outlook.Items oItems = oCalendar.Items;
Outlook.AppointmentItem oAppt = (Outlook.AppointmentItem)oItems.Find("[Key]='the key value'");


But oAppt is coming as null because it is not able to search with that key value.But I am passing the exact value.

Can anyone provide any suggestion ?

Thanks
Panna
 
Old July 23rd, 2009, 01:26 AM
Authorized User
 
Join Date: Dec 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn
Default

It's working fine now with a little changes....

Thanks
Panna
 
Old March 3rd, 2010, 11:46 AM
Registered User
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear Pannasn
how did you solve it, i've got the same problem

mvg
Jüriler





Similar Threads
Thread Thread Starter Forum Replies Last Post
save outlook mail message Mohammad VB How-To 2 January 27th, 2011 04:55 AM
outlook style appointment control help, thanks! raybristol C# 0 January 17th, 2006 11:39 PM
Accessing Properties in User Controls andyj00 Classic ASP Professional 1 May 21st, 2005 02:52 PM
to save forms' properties vubinhsg BOOK: Access 2003 VBA Programmer's Reference 1 December 20th, 2004 06:20 PM
automate access date to outlook appointment serverrunner Access 2 August 2nd, 2004 08:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.