Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

The wrapper is much more complex then it should be :( The documentation is incomplete and hence confusing.
I think I will drop all recurrence related parameters. So
$iSensitivity will be the last supported parameter.

If recurrence is needed this should be set by calling the full blown functions. This way you get the full documentation and examples.

What's your opinion?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I like that suggestion.

The ay I have looked a this, is that the FULL functions are available if you need to do everything, but to get going and get a feel of capabilities the (simple) wrappers are a great way to get started.

Please do this 

Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

This is the stripped down function code as I think it should look like:

; #FUNCTION# ====================================================================================================================
; Name...........: _OL_Wrapper_CreateAppointment
; Description ...: Creates an appointment (wrapper function).
; Syntax.........: _OL_Wrapper_CreateAppointment($oOL, $sSubject, $sStartDate[, $vEndDate = 30[, $sLocation = ""[, $bAllDayEvent = False[, $sBody = ""[, $iReminder = 15[, $iShowTimeAs = $olBusy[, $iImportance = $olImportanceNormal[, $iSensitivity = ""]]]]]]])
; Parameters ....: $oOL                    - Outlook object returned by a preceding call to _OL_Open()
;                  $sSubject               - The Subject of the Appointment.
;                  $sStartDate             - Start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally.
;                  $vEndDate               - [optional] End date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally OR
;                                            Number of minutes (default = 30 minutes).
;                  $sLocation              - [optional] The location where the meeting is going to take place (default = "").
;                  $bAllDayEvent           - [optional] True or False(default). If set to True and the appointment is lasting for more than one day,
;                                            $vEndDate must be one day higher than the actual end Date.
;                  $sBody                  - [optional] The Body of the Appointment (default = "").
;                  $iReminder              - [optional] Reminder in Minutes before $sStartDate, 0 for no reminder (default = 15).
;                  $iShowTimeAs            - [optional] One of this constants: $olBusy (default), $olFree, $olOutOfOffice or $olTentative.
;                  $iImportance            - [optional] One of this constants: $olImportanceNormal (default), $olImportanceHigh or $olImportanceLow.
;                  $iSensitivity           - [optional] One of this constants: $olNormal (default), $olPersonal, $olPrivate or $olConfidential.
; Return values .: Success - Object of the appointment
;                  Failure - Returns 0 and sets @error:
;                  |1    - $sStartDate is invalid
;                  |2    - $sBody is missing
;                  |4    - $sTo, $sCc and $sBCc are missing
;                  |1xxx - 1000 + error returned by function _OL_FolderAccess
;                  |2xxx - 2000 + error returned by function _OL_ItemCreate
;                  |3xxx - 3000 + error returned by function _OL_ItemModify
; Author ........: water
; Modified.......:
; Remarks .......: This is a wrapper function to simplify creating an appointment. If you have to set more properties etc. you have to do all steps yourself
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_Wrapper_CreateAppointment($oOL, $sSubject, $sStartDate, $vEndDate = 30, $sLocation = "", $bAllDayEvent = False, $sBody = "", $iReminder = 15, $iShowTimeAs = $olBusy, $iImportance = $olImportanceNormal, $iSensitivity = $olNormal)

    If $vEndDate = Default Then $vEndDate = 30
    If $sLocation = Default Then $sLocation = ""
    If $bAllDayEvent = Default Then $bAllDayEvent = False
    If $sBody = Default Then $sBody = ""
    If $iReminder = Default Then $iReminder = 15
    If $iShowTimeAs = Default Then $iShowTimeAs = $olBusy
    If $iImportance = Default Then $iImportance = $olImportanceNormal
    If $iSensitivity = Default Then $iSensitivity = $olNormal
    If Not _DateIsValid($sStartDate) Then Return SetError(1, 0, 0)
    Local $sEnd, $oItem
    ; Access the default calendar
    Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderCalendar)
    If @error Then Return SetError(@error + 1000, @extended, 0)
    ; Create an appointment item in the default calendar and set properties
    If _DateIsValid($vEndDate) Then
        $sEnd = "End=" & $vEndDate
    Else
        $sEnd = "Duration=" & Number($vEndDate)
    EndIf
    $oItem = _OL_ItemCreate($oOL, $olAppointmentItem, $aFolder[1], "", "Subject=" & $sSubject, "Location=" & $sLocation, "AllDayEvent=" & $bAllDayEvent, _
            "Start=" & $sStartDate, "Body=" & $sBody, "Importance=" & $iImportance, "BusyStatus=" & $iShowTimeAs, $sEnd, "Sensitivity=" & $iSensitivity)
    If @error Then Return SetError(@error + 2000, @extended, 0)
    ; Set reminder properties
    If $iReminder <> 0 Then
        $oItem = _OL_ItemModify($oOL, $oItem, Default, "ReminderSet=True", "ReminderMinutesBeforeStart=" & $iReminder)
        If @error Then Return SetError(@error + 3000, @extended, 0)
    Else
        $oItem = _OL_ItemModify($oOL, $oItem, Default, "ReminderSet=False")
        If @error Then Return SetError(@error + 3000, @extended, 0)
    EndIf
    Return $oItem

EndFunc   ;==>_OL_Wrapper_CreateAppointment

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...