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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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!

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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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

Tested on 2007-2013, works great. Thanks.


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

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-10-19 - Version 1.4.10.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

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.


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

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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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-10-19 - Version 1.4.10.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

    • nooneclose
      By nooneclose
      Hello again everyone, I am trying to make a simple bot/AI to help me at work. I need it to read the subject line of emails, open them if a certain subject line is found, and then copy the contents of the said email and paste it in a different program. 
      Can the Autoit outlook UDF help me achieve this? 
      Also, I have tried the Outlook UDF and so far I have only figured out how to find all the unread emails (thanks to one of water's example scripts. @water you are a genius just saying).
      I am very new to this UDF and would love any help that would guide me into making this bot/AI a reality at work.   
    • caramen
      By caramen
      I watched _OL_ItemSend&_OL_ItemFind&_OL_ItemCreate in OutlookEx UDF but hmmm
       
      Since it use the test environnement i cant get the orders of the mail creation
       
      Can someone make me win some time of reading all exemples script and lead me how to do one ?
      That whould be lovely.
      Gnight
    • Tersion
      By Tersion
      Here the this wiki page with list of available UDFs for data compression. For my tasks I only need ZIP support, so I started looking at pure AutoIt UDFs without any 3rd party dlls. And found out that most of available realizations uses standard ("native method") Windows dll - "zipfldr.dll". So for now I chose ZIP UDF by wraithdu. I've tested it on Windows 7 (x64) and it seem works fine. But here the comment from another topic where user says that Windows 10 discontinued support of "zipfldr.dll". Now I confused. I don't have around any Windows 10 machine to tested it. So maybe someone could confirm or deny that? Or maybe would better to switch to UDF with 7zip dll?
      I need an advice...
    • water
      By water
      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
    • TheSaint
      By TheSaint
      Here is the bare bones of a UDF I have started work on.
      Mostly just a proof of concept at this stage, and still need to add some functions and dress the UDF up a bit ... to look like a UDF ... though it has my own distinct styling, especially as I have never really developed a UDF before now .... used plenty and modified plenty though. I've even invented my own UDF variable naming convention, which I am sure some of you will be aghast at. I work with what feels best for me, but others are free to adapt if they wish.
      The idea is to emulate the simplicity of INI files, but gain the benefits of SQL.
      Two scripts are provided.
      (1) The UDF, a work in progress - SimpleSQL_UDF.au3
      (2) An example or testing script - UDF_Test.au3
      Another first for me, is creating a 2D array from scratch, never done that before, that I can recall ... never had a need, and even for 1 dimension arrays, for a long time now, I have just used _StringSplit to create them. So I needed a bit of a refresher course, which my good buddy @TheDcoder assisted me with ... not without some angst I might add. LOL
      SimpleSQL_UDF.zip  (12 downloads previously)
      (I have now completed all the functions I intended to. My next update will be a big improvement, bringing things more inline with my latest INItoSQL DB program changes.)
      Program requires the sqlite3.dll, not included, but easily enough obtained.
      Hopefully the usage is self-evident ... just change the Job number variable in the UDF_Test.au3 file to check the existing functions out.
      Enjoy!
      P.S. This is also related to a new program I have just finished and uploaded - INItoSQL DB
×