Open calendar from code?

E

Eric

H!! I want to open a calender from code so that I can view/edit an
appointment. I found this code. It works great. However, I don't want to
open the specific appointment, I just want to
display the calendar for that day (where the appointment is). Any ideas?

/e

Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim fdCalendar As Outlook.MAPIFolder
Dim itmsCalendar As Outlook.Items
Dim itm As Object
Dim criteria As String

Set ns = ol.GetNamespace("MAPI")

'Reference the deafult Calendar folder and then
'return the Items collection of the folder
Set fdCalendar = ns.GetDefaultFolder(olFolderCalendar)
Set itmsCalendar = fdCalendar.Items

'Establish the criteria and locate the Appointment
criteria = "[Subject] = " & "'" & Subject & "'" & ""
Set itm = itmsCalendar.Find(criteria)

'Determine if the item was found
If itm Is Nothing Then
MsgBox "Unable to locate the item."
FindAnAppt = False
Else
'Display the Appointment
itm.Display
FindAnAppt = True
End If
 
S

Sue Mosher [MVP-Outlook]

Ken Slovak already gave you the answer, over in the other group where you posted. You'd need to use the GoToDate method, but with caution.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
E

Eric

OK, thanks, I'll give it a try.

/e

"Sue Mosher [MVP-Outlook]" <[email protected]> skrev i meddelandet
Ken Slovak already gave you the answer, over in the other group where you
posted. You'd need to use the GoToDate method, but with caution.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top