Solved

Outlook calendar VBA - find time zone of item

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 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