Set Calendar entry in MS. Outlook

J

James C.

I have the following function that sets a calendar entry in MS. Outlook from
one of my forms. This works fine but it always sets the appointment to "Busy"
time instead of "Free"

When someone uses this I want it to set the appointment but have it still
show up in the calendar as free time?

Any ideas

Here is my code:

unction ExportToCalendar()

Dim olkApp As New Outlook.Application
Dim olkCalendar As Outlook.MAPIFolder
Dim olkNameSpace As Outlook.NameSpace

Set olkNameSpace = olkApp.GetNamespace("MAPI")
Set olkCalendar = olkNameSpace.GetDefaultFolder(olFolderCalendar)

With olkCalendar.Items.Add(olAppointmentItem)
.AllDayEvent = True
.Start = #9/21/2005 8:00:00 AM#
.End = #9/21/2005 9:00:00 AM#
.Subject = "This is a test subject"
.Save
End With

End Function
 
D

David Lloyd

James:

I believe the property you are looking for is the BusyStatus property. For
example:

With olkCalendar.Items.Add(olAppointmentItem)
.AllDayEvent = True
.Start = #9/21/2005 8:00:00 AM#
.End = #9/21/2005 9:00:00 AM#
.Subject = "This is a test subject"
.BusyStatus = olFree
.Save
End With

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have the following function that sets a calendar entry in MS. Outlook from
one of my forms. This works fine but it always sets the appointment to
"Busy"
time instead of "Free"

When someone uses this I want it to set the appointment but have it still
show up in the calendar as free time?

Any ideas

Here is my code:

unction ExportToCalendar()

Dim olkApp As New Outlook.Application
Dim olkCalendar As Outlook.MAPIFolder
Dim olkNameSpace As Outlook.NameSpace

Set olkNameSpace = olkApp.GetNamespace("MAPI")
Set olkCalendar = olkNameSpace.GetDefaultFolder(olFolderCalendar)

With olkCalendar.Items.Add(olAppointmentItem)
.AllDayEvent = True
.Start = #9/21/2005 8:00:00 AM#
.End = #9/21/2005 9:00:00 AM#
.Subject = "This is a test subject"
.Save
End With

End Function
 

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