Solved

Outlook calendar VBA - find time zone of item

Posted on 2016-09-06
2
77 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…

839 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