open appointment window in Calendar (Outlook)

G

Guest

I'm trying to click the button in MS Access to open a window to shedule a
meeting.
But, I can open only the New message window from the Mail.
How could I open the Appointment window from the Calendar?
I'm using the following code:
Private Sub cmdMeeting_Click()
Dim bStarted As Boolean
Dim objOutlook As Object
Dim objMeeting As Object

Set objOutlook = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set objOutlook = CreateObject("Outlook.Application")
bStarted = True
End If

Set objMeeting = objOutlook.CreateItem(olAppointmentItem)
With objMeeting

.Subject = "The meeting"

End With

objMeeting.Display

On Error Resume Next

If bStarted Then
'If we started Outlook from code, then close it
objOutlook.Quit
End If

Set objMeeting = Nothing
Set objOutlook = Nothing

End Sub
I'm trying to use
Set olkNameSpace = objOutlook.GetNamespace("MAPI")
Set olkCalendar = olkNameSpace.GetDefaultFolder(olFolderCalendar) ' here is
an error
But I don't now how to use it As Objects.

Thanks
 
G

Guest

The forms for this works great, I am having a difficult time the the pop-up
Calender, it gives me an error. "Complile Error, variable not defined" when I
click on a date on the calendar.
Private Function Set Date
ctlDate = Screen.ActiveControl

Thanks,
Colette
 

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