Jump to content

OutlookEX 1.3.4.1

   (0 reviews)

1 Screenshot

About This File

Extensive library to control and manipulate Microsoft Outlook.

Theads: Development - General Help & Support - Example Scripts - Wiki

BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort :)


KNOWN BUGS (last changed: 2018-09-01)

  • None

What's New in Version 1.3.4.1

Released

 

CHANGED FUNCTIONS

  • _OL_ItemGet: The function now allows to translate the EntryID of an item to the item object.
  • Like 27



User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

  • Similar Content

    • water
      By water
      I just noticed that Outlook does not allow to import iCal events programmatically.
      I might implement some of the iCalendar data format (RFC 55459) if someone is interested
      Please post here or click the "Like" button if you think this is a good idea
      2019-01-18: Version 0.1:
      AutoItSetOption("MustDeclareVars", 1) #include <..\OutlookEx.au3> ; <== Please modify #include <Array.au3> Global $siCalPath = @ScriptDir & "\test.ICS" ; <== Please modify Global $oOL = _OL_Open() Global $aFolder = _OL_FolderAccess($oOL, "*\Kalender") ; <== Please modify If @error Then Exit MsgBox(0, "", @error) Global $aResult = _OL_iCalImport($oOL, $aFolder[1], $siCalPath, True) If @error Then Exit MsgBox(0, "Error creating iCal", "@error = " & @error & ", @extended =" & @extended) _ArrayDisplay($aResult) Exit #cs 3.6.1. Event Component Component Name: VEVENT Purpose: Provide a grouping of component properties that describe an event. Format Definition: A "VEVENT" calendar component is defined by the following notation: eventc = "BEGIN" ":" "VEVENT" CRLF eventprop *alarmc "END" ":" "VEVENT" CRLF eventprop = *( ; ; The following are REQUIRED, but MUST NOT occur more than once. ; dtstamp / uid / ; ; The following is REQUIRED if the component appears in an iCalendar object that doesn't ; specify the "METHOD" property; otherwise, it is OPTIONAL; in any case, it MUST NOT occur more than once. ; dtstart / ; ; The following are OPTIONAL, but MUST NOT occur more than once. ; class / created / description / geo / last-mod / location / organizer / priority / seq / status / summary / transp / url / recurid / ; ; The following is OPTIONAL, but SHOULD NOT occur more than once. ; rrule / ; ; Either 'dtend' or 'duration' MAY appear in a 'eventprop', but 'dtend' and 'duration' MUST NOT occur in the same 'eventprop'. ; dtend / duration / ; ; The following are OPTIONAL, and MAY occur more than once. ; attach / attendee / categories / comment / contact / exdate / rstatus / related / resources / rdate / x-prop / iana-prop ; ) Description: A "VEVENT" calendar component is a grouping of component properties, possibly including "VALARM" calendar components, that represents a scheduled amount of time on a calendar. For example, it can be an activity; such as a one-hour long, department meeting from 8:00 AM to 9:00 AM, tomorrow. Generally, an event will take up time on an individual calendar. Hence, the event will appear as an opaque interval in a search for busy time. Alternately, the event can have its Time Transparency set to "TRANSPARENT" in order to prevent blocking of the event in searches for busy time. The "VEVENT" is also the calendar component used to specify an anniversary or daily reminder within a calendar. These events have a DATE value type for the "DTSTART" property instead of the default value type of DATE-TIME. If such a "VEVENT" has a "DTEND" property, it MUST be specified as a DATE value also. The anniversary type of "VEVENT" can span more than one date (i.e., "DTEND" property value is set to a calendar date after the "DTSTART" property value). If such a "VEVENT" has a "DURATION" property, it MUST be specified as a "dur-day" or "dur-week" value. The "DTSTART" property for a "VEVENT" specifies the inclusive start of the event. For recurring events, it also specifies the very first instance in the recurrence set. The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event. For cases where a "VEVENT" calendar component specifies a "DTSTART" property with a DATE value type but no "DTEND" nor "DURATION" property, the event's duration is taken to be one day. For cases where a "VEVENT" calendar component specifies a "DTSTART" property with a DATE-TIME value type but no "DTEND" property, the event ends on the same calendar date and time of day specified by the "DTSTART" property. The "VEVENT" calendar component cannot be nested within another calendar component. However, "VEVENT" calendar components can be related to each other or to a "VTODO" or to a "VJOURNAL" calendar component with the "RELATED-TO" property. Example: The following is an example of the "VEVENT" calendar component used to represent a meeting that will also be opaque to searches for busy time: BEGIN:VEVENT UID:19970901T130000Z-123401@example.com DTSTAMP:19970901T130000Z DTSTART:19970903T163000Z DTEND:19970903T190000Z SUMMARY:Annual Employee Review CLASS:PRIVATE CATEGORIES:BUSINESS,HUMAN RESOURCES END:VEVENT The following is an example of the "VEVENT" calendar component used to represent a reminder that will not be opaque, but rather transparent, to searches for busy time: BEGIN:VEVENT UID:19970901T130000Z-123402@example.com DTSTAMP:19970901T130000Z DTSTART:19970401T163000Z DTEND:19970402T010000Z SUMMARY:Laurel is in sensitivity awareness class. CLASS:PUBLIC CATEGORIES:BUSINESS,HUMAN RESOURCES TRANSP:TRANSPARENT END:VEVENT The following is an example of the "VEVENT" calendar component used to represent an anniversary that will occur annually: BEGIN:VEVENT UID:19970901T130000Z-123403@example.com DTSTAMP:19970901T130000Z DTSTART;VALUE=DATE:19971102 SUMMARY:Our Blissful Anniversary TRANSP:TRANSPARENT CLASS:CONFIDENTIAL CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION RRULE:FREQ=YEARLY END:VEVENT The following is an example of the "VEVENT" calendar component used to represent a multi-day event scheduled from June 28th, 2007 to July 8th, 2007 inclusively. Note that the "DTEND" property is set to July 9th, 2007, since the "DTEND" property specifies the non-inclusive end of the event. BEGIN:VEVENT UID:20070423T123432Z-541111@example.com DTSTAMP:20070423T123432Z DTSTART;VALUE=DATE:20070628 DTEND;VALUE=DATE:20070709 SUMMARY:Festival International de Jazz de Montreal TRANSP:TRANSPARENT END:VEVENT #ce ; #FUNCTION# ==================================================================================================================== ; Name...........: _OL_iCalImport ; Description ...: Import iCal events to an Outlook calendar. ; Syntax.........: _OL_iCalImport($oOL, $vFolder, $siCalPath[, $bDebug = False]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $vFolder - Calendar folder object as returned by _OL_FolderAccess or full name of folder where the event items will be created ; $siCalPath - Path and file name of the ICS file to import ; $bDebug - Optional: True writes debug messages of processed/ignored properties to the Console (default = False) ; Return values .: Success - two-dimensional one based array with the following information: ; |0 - Object of the created Outlook event item ; |1 - Start date-time of the event item ; |2 - End date-time of the event item ; |3 - Subject of the event item ; Failure - Returns 0 and sets @error: ; |1 - File $siCalPath does not exist ; Author ........: water, mikell (RegExp for "DURATION") ; Modified ......: ; Remarks .......: This function processes the following properties according to RFC 5545 (properties not listed will be ignored): ; DTSTART ; DTEND ; DURATION ; SUMMARY ; DESCRIPTION ; TRANSP ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _OL_iCalImport($oOL, $vFolder, $siCalPath, $bDebug = False) If Not FileExists($siCalPath) Then Return SetError(1, 0, 0) Local $iEventStart, $iEventEnd, $sEventSubject, $sEventBody Local $aICS = FileReadToArray($siCalPath) If StringLeft($aICS[0], 6) = "BEGIN:" And StringMid($aICS[0], 7, 9) <> "VCALENDAR" Then Return SetError(2, 0, 0) Local $i = 1, $iMaxIndex = UBound($aICS) - 1, $aEventsCreated[1000][4], $iEvent = 0, $oItemCreated While 1 If $aICS[$i] = "BEGIN:VEVENT" Then If $bDebug Then ConsoleWrite("BEGIN:VEVENT----------------------------------------------------" & @CRLF) ; Reset all event related variables for the next event Local $aEvent[10] = [] ; DTSTART[0], DTEND[1], UTC[2], ALLDAY[3], SUMMARY[4], DESCRIPTION[5], TRANSP[6] Do $i += 1 If $i > $iMaxIndex Then ExitLoop Select Case StringLeft($aICS[$i], 8) = "DTSTART;" ; 3.8.2.4. in RFC 5545 $aEvent[0] = _OL_TranslateDT(StringMid($aICS[$i], 9), $aEvent) If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[0] & @CRLF) Case StringLeft($aICS[$i], 6) = "DTEND;" ; 3.8.2.2. in RFC 5545 - specifies the non-inclusive end of the event. $aEvent[1] = _OL_TranslateDT(StringMid($aICS[$i], 7), $aEvent) If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[1] & @CRLF) Case StringLeft($aICS[$i], 9) = "DURATION:" ; 3.8.2.5. in RFC 5545. $aEvent[1] = _OL_TranslateDuration($aEvent[0], StringMid($aICS[$i], 10)) If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[1] & @CRLF) Case StringLeft($aICS[$i], 8) = "SUMMARY:" ; 3.8.1.12. in RFC 5545 $aEvent[4] = StringMid($aICS[$i], 9) If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[4] & @CRLF) Case StringLeft($aICS[$i], 12) = "DESCRIPTION:" ; 3.8.1.5. in RFC 5545 $aEvent[5] = StringMid($aICS[$i], 13) If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[5] & @CRLF) Case StringLeft($aICS[$i], 7) = "TRANSP:" ; 3.8.2.7. in RFC 5545 $aEvent[6] = (StringMid($aICS[$i], 8) = "OPAQUE") ? $olBusy : $olFree If $bDebug Then ConsoleWrite("Processed: " & @CRLF & " IN.: " & $aICS[$i] & @CRLF & " OUT: " & $aEvent[6] & @CRLF) Case $aICS[$i] = "END:VEVENT" If $bDebug Then ConsoleWrite("END:VEVENT------------------------------------------------------" & @CRLF) Case Else If $bDebug Then ConsoleWrite("Ignored: " & @CRLF & " " & $aICS[$i] & @CRLF) EndSelect Until $aICS[$i] = "END:VEVENT" $oItemCreated = _OL_ItemCreate($oOL, $olAppointmentItem, $vFolder, "", "Subject=" & $aEvent[4], "Start=" & $aEvent[0], "End=" & $aEvent[1], "Body=" & $aEvent[5], "AllDayEvent=" & $aEvent[3], "BusyStatus=" & $aEvent[6]) If @error Then Exit MsgBox(0, "Error", @error) $aEventsCreated[$iEvent][0] = $oItemCreated $aEventsCreated[$iEvent][1] = $aEvent[0] $aEventsCreated[$iEvent][2] = $aEvent[1] $aEventsCreated[$iEvent][3] = $aEvent[4] $iEvent += 1 If Mod($iEvent, 999) = 0 Then ReDim $aEventsCreated[$iEvent + 1000][4] EndIf $i += 1 If $i > $iMaxIndex Then ExitLoop WEnd ReDim $aEventsCreated[$iEvent][4] Return $aEventsCreated EndFunc ;==>_OL_iCalImport ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _OL_TranslateDT ; Description ...: Translates DATE or DATE-TIME to YYYY/MM/DD HH:MM:SS. ; Syntax.........: _OL_TranslateDT($sDateTime, ByRef $aEvent) ; Parameters ....: $sDateTime - DATE or DATE-TIME to be translated ; $aEvent - one-dimensional array as used by _OL_iCalImport to return the UTC and AllDay information ; Return values .: Success - formatted DATE-TIME string. ; Failure - Returns "" and sets @error: ; 2 = Pattern invalid. @extended = offset of error in pattern ; Author ........: water ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _OL_TranslateDT($sDateTime, ByRef $aEvent) ; <== Verbessern, so dass nur ein Rückgabewert notwendig ist Local $aTemp = StringSplit($sDateTime, ":") Local $sDTValue If $aTemp[$aTemp[0] - 1] = "VALUE=DATE" Then $sDTValue = StringRegExpReplace($aTemp[$aTemp[0]], "(\d{4})(\d{2})(\d{2})", "$1/$2/$3") ; translate last value after the split (YYYYMMDD) to YYYY/MM/DD If @error Then Return SetError(@error, @extended, 0) $aEvent[3] = True ElseIf $aTemp[$aTemp[0] - 1] = "VALUE=DATE-TIME" Then $aTemp[$aTemp[0]] = StringReplace($aTemp[$aTemp[0]], "Z", "") ; Remove "Z" at the end of the string for UTC If @extended = 1 Then $aEvent[2] = True $sDTValue = StringRegExpReplace($aTemp[$aTemp[0]], "(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})", "$1/$2/$3 $4:$5:$6") ; translate last value after the split (YYYYMMDDTHHMMSS) to YYYY/MM/DD HH:MM:SS If @error Then Return SetError(@error, @extended, 0) $aEvent[3] = False EndIf Return $sDTValue EndFunc ;==>_OL_TranslateDT ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _OL_TranslateDuration ; Description ...: Translate the DURATION property and add the values to the start DATE-TIME. ; Syntax.........: _OL_TranslateDuration($sDateTime, $sDuration) ; Parameters ....: $sDateTime - DATE or DATE-TIME to be translated. Format: YYYY/MM/DD HH:MM:SS. ; $sDuration - Duration to be added to the start DATE-TIME. ; Return values .: Success - Calculated DATE-TIME. Format: YYYY/MM/DD HH:MM:SS. ; Failure - Returns 0 and sets @error: ; |1 - StringRegExp: No matches found ; |2 - StringRegExp: Bad pattern. @extended = offset of error in pattern. ; Author ........: water, mikell (RegExp for "DURATION") ; Modified ......: ; Remarks .......: RegExp taken from https://www.autoitscript.com/forum/topic/197397-translate-rfc-2445-duration-format/?do=reportComment&comment=1415924 ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _OL_TranslateDuration($sDateTime, $sDuration) $aResult = StringRegExp($sDuration, 'P(?:(\d*)W)?(?:(\d*)D)?T?(?:(\d*)H)?(?:(\d*)M)?(?:(\d*)S?)', 3) If @error Then Return SetError(@error, @extended, 0) If Number($aResult[0]) > 0 Then $sDateTime = _DateAdd("w", $aResult[0], $sDateTime) If Number($aResult[1]) > 0 Then $sDateTime = _DateAdd("d", $aResult[1], $sDateTime) If Number($aResult[2]) > 0 Then $sDateTime = _DateAdd("h", $aResult[2], $sDateTime) If Number($aResult[3]) > 0 Then $sDateTime = _DateAdd("n", $aResult[3], $sDateTime) If Number($aResult[4]) > 0 Then $sDateTime = _DateAdd("s", $aResult[4], $sDateTime) Return $sDateTime EndFunc ;==>_OL_TranslateDuration  
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends,
      I am having a requirement where i have to automate outllook.I have to send mail using outlook.Whe i went through the forum i got OutLookEx.au3 but when i am trying to use this i am getting error can anyone help me in using this? @water
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I'm working on a project where incoming emails are to be analyzed based on the subject line and moved to various folders in a shared mailbox.
      I'm using "OutlookEx.au3" of @water. The macro can can move emails  to any folder that I newly create. But the macro couldn't move emails to specific folders that are already existing.
      I checked the permission levels of those folders and found that nothing is wrong with that. The function I use is _OL_ItemMove.
      Please guide me how to proceed further. Thanks in advance.
      -Gowrisankar.
       
    • nooneclose
      By nooneclose
      Good morning everyone, I thought I had already solved this issue but it turns out I did not. 
      My code finds unread emails with this specific subject line of "request" but when I change the subject to SKIPPED + "request" = ("SKIPPED request") the program still finds the email and tries to process it. I only want to process emails with the exact match subject of "request".
      Here is my code that "finds" the unread emails with the subject of "request" or so I thought. 
      Func ListUnreadEmails() ;******************************************************************************* ; Lists all unread E-mails from the folder Outlook-UDF-Test ;******************************************************************************* ; Stores all the unRead emails into an array Global $aItems = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test", $olMail, _ "[UnRead]=True", "Subject", "request", "EntryID,Subject", "", 1) ; Displays the array of unRead emails If IsArray($aItems) Then ;_ArrayDisplay($aItems, "OutlookEX UDF: _OL_ItemFind - Unread mails") Else MsgBox(48, "OutlookEX UDF: _OL_ItemFind Example Script", _ "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf ; Gets the number of unread emails Global $numberOfUnRead = UBound($aItems, $UBOUND_ROWS) - 1 ;MsgBox("", "Number of Unread emails", $numberOfUnRead) EndFunc It acts as if any part of the subject containing the word "request" and the email is unread that it will try to process it. (I think)
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
×