Do you mean to open Outlook and display the default Calendar folder?
Sub ShowCalendar()
Dim oOL As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oExplorer As Outlook.Explorer
Dim oFolder As Outlook.MAPIFolder
Set oOL = CreateObject("Outlook.Application")
Set oNS = oOL.GetNameSpace("MAPI")
oNS.Logon
Set oFolder = oNS.GetDefaultFolder(olFolderCalendar)
If oNS.Explorers.Count = 0 Then
Set oExplorer = oNS.Explorers.Add(oFolder)
Else
Set oExplorer = oOL.ActiveExplorer
Set oExplorer.CurrentFolder = oFolder
End If
oFolder.Display
End Sub
There's no error trapping there and you need to set all objects = Nothing at
the end of the Sub but that should give you the idea.
When i run your code from my cmd button i get this error msg "RunTime Error
438, Object doesnt support this property or method" and code breaks at If
oNS.Explorers.Count = 0 Then
Many Many thanks, you've solved something i've been trying to do for ages.
Once gain thanks.
One other thing, if you dont mind. The calendar opens as a small window in
the middel of my screen, do you know how to open it maximised?? i tried
DoCmd.Maximize at the end of the code but it maximises my form, not the
calendar