Solved

Outlook calendar VBA - find time zone of item

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Set OWA language and time zone in Exchange for individuals, all users or per database.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

706 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

19 Experts available now in Live!

Get 1:1 Help Now