OutlookEX UDF - Meeting Item

From AutoIt Wiki
Revision as of 12:58, 21 January 2013 by IEvKI3gv9Wrkd41u (talk | contribs) (+Category:OutlookEX_UDF)
Jump to navigation Jump to search

This page is still a work in progress.

Here you'll find detailed description if you work with Meeting items.

Wrapper functions

The following functions are "wrappers" that combine multiple function calls to mimic functions available in the "original" Outlook UDF.
This should make your scripts a bit shorter and live a bit easier.

CreateAppointment

The wrapper function CreateAppointment allows to create an appointment, setting subject, body, start and end date, duration, location, reminder, recurrence information etc. in one go. This wrapper function mimics the function of _OutlookCreateAppointment of the original UDF.

Example:

#include <OutlookEx.au3>
$oOL = _OL_Open()
Global $sStart = StringLeft(_Nowcalc(),16)
Global $sEnd   = StringLeft(_DateAdd("h", 3, _NowCalc()), 16)
_OL_Wrapper_CreateAppointment($oOutlook, "Test Appointment", $sStart, $sEnd, "My office", False, "Testbody", _
    15, $olBusy, $olImportanceHigh, $olPrivate, $olRecursWeekly, $sStart, _DateAdd("w", 3, $sEnd), 1)
_OL_Close()

This creates an appointment and sets subject, start and end date/time of the first occurence, location, body, importance, sensitivity, recurrence type to weekly and end of recurrence to 3 weeks later.

Tips & Tricks

Send a meeting invitation

Set property MeetingStatus to value '1' (the meeting has been scheduled) and send the item to the attendees.

Example:

#include <OutlookEx.au3>
; Open the connection to Outlook
Global $oOL = _OL_Open()
; Create an appointment and set some properties
$oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, "*\Calendar", "", _
  "Subject=Meeting", "Start=" & _DateAdd("D", 3, _NowCalcDate() & " 08:00:00"), "Duration=60", _
  "Location=Building A, Room 10", "RequiredAttendees=<Name Firstname>", "MeetingStatus=1")
; Send the meeting request
_OL_ItemSend($oOL, $oItem)

This creates an appointment in the senders calendar and sends a meeting request to attendee <Name Firstname>. The meeting starts in 3 days from today at eight o'clock and lasts an hour.

Cancel a meeting and send cancel requests to the attendees

Set property MeetingStatus to value '5' (the scheduled meeting has been cancelled) and re-send the item to the attendees.

Example:

#include <OutlookEx.au3>
; Open the connection to Outlook
Global $oOL = _OL_Open()
; Get the appointment you want to cancel
$aResult = _OL_ItemFind($oOL, "*\Calendar", "", "[Subject]='Meeting'", "", "", "EntryID")
$oItem = _OL_ItemModify($oOL, $aResult[1][0], Default, "MeetingStatus=5")
; Send the meeting request
_OL_ItemSend($oOL, $oItem)

This removes the appointment from the senders calendar and sends a cancel request to every attendee.