Setting timezone options with CDO 1.21.
CDO 1.21 Timezone information is stored in a a property inside of the user's mailbox and is CDO 1.21 specific. It is set any time a CDO 1.21 session sets the time zone and persists for that user until changed. This means it will be used by any subsequent CDO 1.21 session.
OWA 5.5 will affect the timezone and Outlook & OWA 2000/2003 will not. OWA 5.5 used CDO 1.21. OWA 2000/2003 uses Webdav and CDOEX to do its processing. The setoption metod of the CDO 1.21 Session will allow you to set the Timezone setting.
When CDO 1.21 has the sessions object uses setoption to set the timezone, the timezone is set for the mailbox and is stored in the inbox.
Example of a CDO 1.21 call:
Private Sub cmdGetTimeZone_Click()
Dim objSession As MAPI.Session
Dim lRetVal As Long
Set objSession = CreateObject("MAPI.Session")
objSession.Logon ' ...
lRetVal = objSession.GetOption("TimeZone")
MsgBox "The timezone is: " & lRetVal
objSession.Logoff
Set objSession = Nothing
End Sub
Private Sub cmdSetTimeZone_Click()
'Time Zone Constants for the US
Const CdoDefaultFolderCalendar = 0
Const CdoTmzEastern = 10
Const CdoTmzCentral = 11
Const CdoTmzMountain = 12
Const CdoTmzPacific = 13
Dim objSession As MAPI.Session
'Dim lRetVal As Long
Set objSession = CreateObject("MAPI.Session")
objSession.Logon ' ...
objSession.SetOption "TimeZone", CdoTmzEastern
objSession.Logoff
Set objSession = Nothing
End Sub
Comments
- Anonymous
December 19, 2008
' How to add a holiday to a calendar using VB and CDO 1.21. ' ' This example code shows how to add a