Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Access to Outlook Time Zones

$
0
0
Hi All,

I've figured out the code below to add appointments to outlook from access. However, I have a drop down box with time zones. The box is named "Time Zone" and it has values "PST, EST, MST, MDT, CST, CDT" for the time zones. How can I direct outlook to recognize the time zone depending on which one is selected so when I click my command, it inserts the appointment in the right time zone slot?

I've looked into .starttimezone and .endtimezone but I can't seem to get it to work with my drop down selections. Any ideas of code would be great!

' Save record first to be sure required fields are filled.
DoCmd****nCommand acCmdSaveRecord
' Exit the procedure if appointment has been added to Outlook.
If Me!AddedToOutlook = True Then
MsgBox "This appointment already added to Microsoft Outlook"
Exit Sub
' Add a new appointment.
Else
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me!ApptDate & " " & Me!ApptTime
.Duration = Me!ApptLength
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
.Save
End With
End If
' Release the Outlook object variable.
Set outobj = Nothing
' Set the AddedToOutlook flag, save the record, display a message.
Me!AddedToOutlook = True
DoCmd****nCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
AddAppt_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub

Viewing all articles
Browse latest Browse all 13329

Trending Articles