How do I create recurring appointments in different Timezones?

H

Haxsyn

I've written a VB COM AddIn for Outlook which imports meetings from a
server and adds them to a user's Outlook calendar (Not connected to an
exchange server). This works for most types of recurring appointments
but I'm having difficulty with different user Timezones. (N.B. this
isn't a one off import and will run often to keep Outlook in synch.
with the source) I get the appointment details in GMT

I have an appointment that occurs the first Wednesday of the month at
13:00 GMT.

If a user views this from a TimeZone GMT+12 this actually occurs at
01:00 on the Thursday.

The problem is how do I create this appointment in an Outlook calendar
set to TimeZone GMT+12?

At first I thought if I set it to occur the first Thursday of every
month at 1:00 this would work, but if the first day of the month is a
Thursday (e.g. January 2004) it would appear on the 1st instead of the
8th (first Wednesday GMT is the 7th).

Is there a way of creating (programmatically) recurring appointments
using GMT times (when the user is using GMT+12) and letting Outlook
correct them?

If I change the timezone to GMT manually and create the appointment to
recur every first Wednesday of the month and then change the Timezone
to GMT+12 it correctly displays the appointments.

Does anybody know of a way of doing this in a VB AddIn ?
 
K

Ken Slovak - [MVP - Outlook]

All times in Outlook for events and appointments are stored in GMT.
You can see that using OutlookSpy (www.dimastr.com). Outlook
automatically converts the GMT times into local time based on the
user's local settings. The Outlook object model doesn't expose the
local time settings.

You can use CDO 1.21 code, which has a Session.GetOption("TimeZone")
method and use that information to convert everything to what you want
using the offsets from GMT or you can read the local settings from the
Windows registry. There is information about doing that in the MSDN
library.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top