Is is possible to take a date from a varaible and build a string that will open Outlook Calendar and show that day in Outlook Calendar....
Maybe an option to see the week as well?
Anyone ever do this before? Possible?
Thanks in Advance.
Is is possible to take a date from a varaible and build a string that will open Outlook Calendar and show that day in Outlook Calendar....
Maybe an option to see the week as well?
Anyone ever do this before? Possible?
Thanks in Advance.
Google: vba open outlook calendar date
Review
http://www.officekb.com/Uwe/Forum.as...-date-with-VBA
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
THanks June7....I was able to peice it together....I had to make a few changes as for some reason the Application I am working in would not except
Dim objCalendar 'As Outlook.MAPIFolder
Dim olExp 'As Outlook.Explorer
I also had to add this: Const olFolderCalendar = 9
WORKING CODE:
Dim objCalendar
Dim olExp
Const olFolderCalendar = 9
dtmMyDate = "05/05/2013"
Set OL = CreateObject("Outlook.Application")
Set olns = OL.GetNamespace("MAPI")
Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
objCalendar.Display
Set olExp = objCalendar.GetExplorer
Set viw = olExp.CurrentView
viw.GoToDate dtmMyDate
Thanks for the site...read further and was able to test to see if outlook was open if so dont open again....
CODE:
Const olFolderCalendar = 9
Dim objCalendar
Dim olExp
'dtmMyDate = Date + 30
'dtmMyDate = "05/28/2010"
dtmMyDate = txtAppointment
Set OL = CreateObject("Outlook.Application")
Set olns = OL.GetNamespace("MAPI")
' Test to determine if the Outlook window is already open
' If not open a new one, if so push changes to the one open
If OL.ActiveExplorer Is Nothing Then
Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
objCalendar.Display
Set olExp = objCalendar.GetExplorer
Else
Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
Set OL.ActiveExplorer.CurrentFolder = objCalendar
OL.ActiveExplorer.Display
Set olExp = ol.ActiveExplorer.CurrentFolder.GetExplorer
End If
Set viw = olExp.CurrentView
viw.GoToDate dtmMyDate