Solved

Outlook calendar VBA - find time zone of item

Posted on 2016-09-06
2
49 Views
Last Modified: 2016-09-06
Does anyone have the VBA code to open the outlook calendar and access the time zone of existing appointments?

 If this was Excel I'd find it in a heartbeat with VBA but don't understand the object model for Outlook and have been exasperated every time I go near it

While I was in Hawaii all the new calendar appointments I created got set to that time zone. Now back in the Eastern time zone those appointments show in the wrong time and evening appointments show as the next day. A List view does not have time zone as a viewable column.

Steve in NH
0
Comment
Question by:Steve Moland
2 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 41786220
Here's some code to get you started:

Sub cal_test()

Dim myNamespace As Outlook.NameSpace
 
Set myNamespace = Application.GetNamespace("MAPI")
Set my_cal = myNamespace.GetDefaultFolder(olFolderCalendar).Items
 
For Each cal_item In my_cal
  MsgBox "subject: " & cal_item.subject & vbCrLf & "start: " & cal_item.Start & vbCrLf & "end: " & cal_item.End & vbCrLf & "start timezone: " & cal_item.StartTimeZone & vbCrLf & "end timezone: " & cal_item.EndTimeZone
Next

End Sub

Open in new window


To finish it off yourself, probably best set an IF statement for the appointments made during a specific time period.

Also, Outlook objects are always well documented by MS: https://msdn.microsoft.com/en-us/library/office/ff862177.aspx
0
 

Author Closing Comment

by:Steve Moland
ID: 41786358
PERFECT clean example which helped me get the job done. Now I will not shy away from other outlook stuff I run the other way from.  Also thanks for the link to  the documentation.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Read this checklist to learn more about the 15 things you should never include in an email signature.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now