Jump to content
water

OutlookEX UDF - Help & Support (III)

Recommended Posts

water

As the OutlookEX UDF - Help & Support thread has grown too big, I'm starting a new one.
The original thread can be found here.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
gcue

having a hard time duplicating issue now..

Share this post


Link to post
Share on other sites
water

If it works now - don't touch ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
gcue

interesting....

doesn't look like its the warning issue i dont think.

if i run outlook as an admin the script is fine.  if i dont run outlook as an admin, the script crashes.. *sigh*

Share this post


Link to post
Share on other sites
water

I see.

This problem is described in the wiki for the Outlook UDF.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
gcue

hmm this doesnt happen to me though

You get @error = 1 from _OL_Open.

Share this post


Link to post
Share on other sites
gcue

i also noticed, if the script has #requireadmin at the top (which it does because i need it for other stuff) then it crashes.

if it doesnt have #requireadmin it works =)

please dont say spawn off a new script that doesnt have #requireadmin - i am trying to cut down on seperatign from main script!!

any other work around?

Edited by gcue

Share this post


Link to post
Share on other sites
water

i also noticed, if the script has #requireadmin at the top (which it does because i need it for other stuff) then it crashes.

if it doesnt have #requireadmin it works =)

please dont say spawn off a new script that doesnt have #requireadmin - i am trying to cut down on seperatign from main script!!

any other work around?

That's exactly what is described in the wiki:

"It seems that the process that starts or hooks into Outlook needs to be run with the same permissions as Outlook."

Haven't found a workaround so far :(


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

Just curious if there is a way with the UDF to permenently delete items, or if you've ever investigated this? I don't do much with Outlook, but I have one script that cleans my subfolders. Currently, I loop through them with _OL_ItemFind, then _OL_ItemDelete to get rid of all but a certain number (have to retain a certain number of messages, regardless of date). This just sends to the Deleted Items folder, though. I looked briefly at the object model, and am currently doing something like this, but thought I may have missed a better way:

$oOutlook.ActiveExplorer().CommandBars("Menu Bar").Controls("Tools").Controls('Empty "Deleted Items" Folder').Execute()
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
water

There is a way to permanently delete items. I have already changed function _OL_ItemDelete but not published this version.

I will post the function here tomorrow.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

This function lets you permanently delete an item. Please test and tell me if it works for you as desired.

; #FUNCTION# ====================================================================================================================
; Name ..........: _OL_ItemDelete
; Description ...: Deletes an item (contact, appointment ...) using the specified EntryID and StoreID.
; Syntax.........: _OL_ItemDelete($oOL, $sEntryId[, $sStoreID = Default)
; Parameters ....: $oOL        - Outlook object returned by a preceding call to _OL_Open()
;                  $vItem      - EntryID or object of the item to delete
;                  $sStoreID   - Optional: StoreID where the EntryID is stored (default = the users mailbox)
;                  $bPermanent - Optional: If set to True the item is permanently deleted (default = False)
; Return values .: Success - Item object or 0 when $bPermanent has been set to True
;                  Failure - Returns 0 and sets @error:
;                  |1 - No item has been specified
;                  |2 - Item could not be found. EntryID might be wrong
;                  |3 - Item could not be deleted. Please see @extended for more information
;                  |4 - Error returned by _OL_FolderAccess when accessing the Deleted Items folder. @extended is set to the error as returned by _OL_FolderAccess
;                  |5 - Error returned by _OL_ItemMove. @extended is set to the error as returned by _OL_ItemMove
;                  |6 - Error returned by _OL_ItemDelete. @extended is set to the error as returned by _OL_ItemDelete
; Author ........: water
; Modified ......:
; Remarks .......: To cancel a meeting you have to set property "MeetingStatus" to $olMeetingCanceled and send the meeting again
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_ItemDelete($oOL, $vItem, $sStoreID = Default, $bPermanent = Default)
    Local $vTemp = $vitem
    If $bPermanent = Default Then $bPermanent = False
    If Not IsObj($vItem) Then
        If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0)
        $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
        If @error Then Return SetError(2, @error, 0)
    EndIf
    If $bPermanent = False Then
        $vItem.Delete
        If @error Then Return SetError(3, @error, 0)
        Return $vItem
    Else
        Local $oTargetFolder = _OL_FolderAccess($oOutlook, "", $olFolderDeletedItems) ; ==> Folder Deleted Items eines anderen Stores zugreifen?
        If @error Then Return SetError(4, @error, 0)
        Local $oSourceStoreID = $vItem.Parent.StoreId
        Local $oMovedItem = _OL_ItemMove($oOl, $vTemp, $oSourceStoreID, $oTargetFolder[1])
        If @error Then Return SetError(5, @error, 0)
        _OL_ItemDelete($oOL, $oMovedItem.EntryID)
        If @error Then Return SetError(3, @error, 0)
        Return 0
    EndIf
EndFunc   ;==>_OL_ItemDelete
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Thanks for the feedback.

Will be part of the next release.

At the moment the function moves the item to the "deleted items" of the users store and then permanently deletes the item.

Can you think of a situation where this might be a problem when you try to delete an item form another store?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

I think it shouldn't make a difference, but who knows?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Kurto2021

I have a script that runs constantly and is moving sending and deleting emails all the time.  The program locked up a couple times becasue the deleted items gets full.  Is there a way to delete emails and have them not go to the deleted items box.  Is there a way to remove all emails from a folder instead.

Share this post


Link to post
Share on other sites
water

The new version of _OL_ItemDelete I posted in #11 above allows to permanently delete an item. So it doesn't fill up the Deleted Items folder.

To only delete mail items from a folder you need to search all mail items in the folder and then delete them one by one.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Deon

What's the easiest way to show the count of my unread subfolders?
 
I'm using the below at the moment, but want to use OutlookEX if possible to make the script better.

 
At the moment the above script returns '0' even if there is 1 unread email in the subfolder 'Test' of folder 'Inbox'.
 
How do I catch all unread emails in the count?
 
 

$objOutlook = ObjCreate("Outlook.Application")
 
$objNameSpace = $objOutlook.GetNamespace("MAPI")
$objNamespace.Logon("Default Outlook Profile", "", FALSE, TRUE)
$objFolder = $objNamespace.GetDefaultFolder(6)
Msgbox(0,"Unread Email Count",$objFolder.UnreadItemCount)

Share this post


Link to post
Share on other sites
water

To get the number of all unread mails in all subfolders you could use function _OL_FolderTree and then _OL_FolderGet for each returned folder. The array returned by _OL_FolderGet contains the number of unread items.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
mumdigau

I use ItemSendReceive to have Outlook synchronise with my local email server. Unfortunately, this each times opens an Outlook window showing the synchronisation progress. I added WinWaitActive/WinClose to close the window which does so, but that doesn't prevent full screen mode being interrupted (e.g. when watching a video). Any idea how I can avoid that?

mumdigau

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • 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
    • MFrancisca
      By MFrancisca
      Hello! 
      I've been checking the logging UDFs in the wiki, mostly Log4a and Loga and I wanted to ask which one would you recommend for a script that will be executed remotely through PSExec. My main question is where the logs are located in that situation and if I can change that location to a custom one., because I need to retrieve them at the end of execution.
      So in a rough description the process is
      Open PSExec
      Send compiled AutoIT script to remote machine
      Execute script
      Copy logs from the remote to the local machine.
       
      Any opinions? 
    • 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)
×