Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook Object Model
Message
From
28/06/2001 20:23:14
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
28/06/2001 05:01:11
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00524002
Message ID:
00524981
Views:
11
Hi Kevin,

Try this:
#DEFINE olMailItem        0
#DEFINE olAppointmentItem 1
#DEFINE olContactItem     2
#DEFINE olTaskItem        3
#DEFINE olJournalItem     4
#DEFINE olNoteItem        5
#DEFINE olPostItem        6

* ----- Create an instance of Outlook
oOutlookObj = CreateObject("Outlook.Application")

* ----- This will create a new calendar item
oCalendarItem = oOutlookObj.CreateItem(olAppointmentItem)

WITH oCalendarItem
    * ----- If you don't want the creator of the Appointment to be part of the
    *       appointment then add the following line of code. This will remove
    *       them from the appointment. Otherwise remove this line of code and  
    *       the creator of the Appointment will be part of the Appointment.
    .Organizer = ""
    * ----- Recipient(s) of Appointment
    .Recipients.Add("Homer Simpson")
    .Recipients.Add("Marge Simpson")
    .Recipients.Add("Bart Simpson")
    .Recipients.Add("Lisa Simpson")
    .Recipients.Add("Maggie Simpson")
    * ----- Subject of Appointment
    .Subject = "Test Meeting"
    * ----- Location of Appointment
    .Location = "Meeting Room"
    * ----- Start Date/Time of Appointment
    .Start = {29/06/2001 15:00:00}
    * ----- Duration of Appointment in Minutes
    .Duration = 60
    * ----- Body of the Appointment
    .Body = "This is the Body of the Appointment"
    * ----- Set the Reminder for the Appointment
    .ReminderSet = .T.
    * ----- Number of Minutes to remind Recipient before start of Appointment
    *       If not entered then defaults to the Outlook Calendar default.
    .ReminderMinutesBeforeStart = 5
    .Save
ENDWITH

* ----- Release Outlook Objects
RELEASE oOutlookObj
RELEASE oCalendarItem
To find out more about the Outlook Appointment Item, open Outlook and press ALT+F11 then press F2 to bring up the Object Browser. In the object browser look for the AppointmentItem entry in the Class Section. This will give you all the Properties, Methods & Events for the AppointmentItem, hitting F1 on any of these will give you VB Help for the item selected.

I suggest you look at Nigel Coates's OutLook class in the Download section. This gives an excellent insight into how the Outlook Object Model works and is a very useful tool.

Hope this helps,
Gavin...

>Thanks for that Gavin.
>
>Is it possible to then create appointments in the users calender?
>
>Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform