I'm attempting to automate a calendar pull to populate a product we
use (and manually update) extremely regularly. It's essentially 3
screenshots of 3 days of calendars. I'm using various win32 api calls
to find the handle of the active calendar explorer (usually have a
separate window open since I'm monitoring several shared calendars),
pass the focus to that window and grab a screenshot.

My issue is in moving the calendar between various dates. I've been
attempting to use the 'GoToDate' method of my current view, but it
will inexplicably cease to function quite often, and I'm not sure why.

My code is inside of Word, and I've included a shortened version of
what I'm attempting to use. Again: sometimes this works, and sometimes
it doesn't...but I've been unable to determine any rhyme or reason why
not. There's no error message, just nothing happens. Can anyone help
me out?

Sub OutlookDriver()
Dim olApp As Outlook.Application
Dim olExp As Outlook.Explorer
Dim olView As Outlook.View
Dim olrecip As Outlook.Recipient

Set olApp = GetObject(, "Outlook.Application")
Set olExp = olApp.Explorers.Item(2)
Set olView = olExp.CurrentFolder.CurrentView

olView.GoToDate Date + 1

Set olApp = Nothing
Set olExp = Nothing
Set olView = Nothing

End Sub

Many thanks!

Mac
27 May 2011view.GoToDate working inconsistently.Adam and Kelly MacKenzie
Contact Us
All times are in (US) Eastern Daylight Time (GMT -4:00)