Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

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 2024-07-28 - Version 1.6.3.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 (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

If it works now - don't touch ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 see.

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 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
Link to comment
Share on other sites

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 2024-07-28 - Version 1.6.3.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 (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

  • 3 weeks later...
  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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 2024-07-28 - Version 1.6.3.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 (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

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 2024-07-28 - Version 1.6.3.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 (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

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 2024-07-28 - Version 1.6.3.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 (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

  • Moderators

Good question. I have multiple stores set up on my 2013 box. Let me play around with it today and see if I can break something.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

  • 2 weeks later...

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.

Link to comment
Share on other sites

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 2024-07-28 - Version 1.6.3.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 (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

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)
Link to comment
Share on other sites

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 2024-07-28 - Version 1.6.3.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 (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

  • 2 weeks later...

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...