Syncing Outlook Appointments VB.Net

  • Thread starter Thread starter ymw
  • Start date Start date
Y

ymw

I'm working on writing a program (in VB.Net) to synchronize my contacts
& calendar with Outlook's contacts & calendar. To accomplish this for
contacts, I added a custom field to outlook with the unique code this
contact has in my database so that when I synchronize, the program will
know how to match up the contacts from Outlook with the contacts in my
database.
Is there any parallel for appointments-ie, does Outlook give the
ability to add a user defined field to an appointment? From the Outlook
gui, it doesn't seem to exist. If not, does Outlook provide any
"extra" fields that I can make use of for that purpose?
 
You can add user-defined to any Outlook item except a NoteItem, always through the UserProperties.Add method. All items also support the "extra" BillingInformation and Mileage properties.
 
Thanks for all your help.
I've got another question. I'm trying to add an exception to a
recurring appointment. I dont see much help online about how to
accomplish that. Is there a site to find all of the properties of an
Outlook appointment so I can determine which ones have to be set?
 
Easiest way to set properties is with the object browser: I keep it open in Outlook VBA so I can switch back and forth. Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic. The same information is also available at MSDN online.

What kind of exception are you trying to add? Deletion? Different start date/time? What information do you have that would allow you to pinpoint which exception to modify?

The easiest approach may be to use Items.IncludeRecurrences and MAPIFolder.Items.Find to locate the item you want, then just change its properties.
 
For starters, i'll be adding the exceptions that exist in my database:
basically deleting, different start/end/subject etc. I'm going to be
assigning the unique key from my database to each appointment that I
synchronize to outlook so I'll be able to find it easily by looking for
taht key.
It seems that recurrence contains a collection of appointment items
combined in "exception class". How do I set the parent and other
properties of an appointment and then add it to the exception class for
the recurring appointment?
 
You cannot set the parent of an appointment or add to the Exceptions collection directly. An instance automatically becomes a member of the Exceptions collection when you change its properties or delete so that it no longer fits the recurrence patter.
 
So if I have records in my database of recurrence exceptions, there is
no way for me to just "copy" those records into the Outlook "database"?
I would have to modify the parent appointment instead of adding
exceptions?
 
You'd had to modify the individual instances of the parent appointment.
 
Back
Top