Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

Water,

 

New question for you

I have outlook 2013 Minimized to the System Tray.

The code below works with no issues when in the Scite Script Editor. I'using ver 1.2.1.0 of your UDF

Key Item to mention , I'm trying to get this to run in task Scheduler, it will call a batch file that has several commands then at the end

it will call this Autoit Compiled Script. The Scheduled Task is running with Highest Privs, I'm guessing it might have something to do with that

include <D:\OutlookEX.au3>


Global $oOutlook = _OL_Open()

MsgBox(4096,"err",@extended & "/" & @error)

_OL_close($oOutlook)

Once I compile it either to 64bit or 86 it fails and (I do run the exe right click on it and run as admin)

 

Extended Error code = -2147221164

Error code =1

 

If I close outlook and the re-run the above EXE it works, however I cant have outlook closed when this runs

Any Ideas what to try ?

 

 

 

 

Edited by HighlanderSword
Link to comment
Share on other sites

The extended error code -2147221164 translates to HRESULT 0x80040154.
This stands for:

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Do you run the script as administrator or some other user?

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

Running as Administrator, which seems to be the problem, as soon as I run it as Non-Admin it works.

Overall task that is running requires Admin Privs.

 

Ok resolved my issue, I modified my batch Process to call an AutoitScript that uses runas to run the process that needs to send them email as a normal user and not an elevated one

Edited by HighlanderSword
Link to comment
Share on other sites

Glad the problem could be solved :) 

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

Hello Water,

 

Have another new question for you , I'm attempting to do some work with Favorites.

I was able to get the below code to list out the favorites in Autoit

$favGroup = $oOutlook.Application.ActiveExplorer.NavigationPane.Modules.GetNavigationModule(0).NavigationGroups.GetDefaultNavigationGroup(4)
$favFldrs = $favGroup.NavigationFolders


For $r = 1 To $favFldrs.Count

ConsoleWrite($favFldrs.Item($r).folder.FolderPath & @CRLF)
;~ Debug.Print favFldrs.Item(r) & " ----" & favFldrs.Item(r).folder.FolderPath

Next

 

I'm now trying to add favorites with the code below and not having any luck and ideas what i'm doing wrong ?

 

#include <D:\OutlookEX.au3>
#include <Array.au3>

Global $oOutlook = _OL_Open()

 

$objNamespace = $oOutlook.Application.GetNamespace("MAPI")
    $objPane = $oOutlook.Application.ActiveExplorer.NavigationPane
    $objModule = $objPane.Modules.GetNavigationModule(0)
        With $objModule.NavigationGroups
            $objGroup = .GetDefaultNavigationGroup(4)
        EndWith

 

    $folder=_ol_folderget($oOutlook,"Paul Schrader 2012\AMD")
    _ArrayDisplay($folder)

            $objNavFolder = $objGroup.NavigationFolders.Add($folder[5])

Edited by HighlanderSword
Link to comment
Share on other sites

Did you have a look at _OL_BarShortcutAdd?
There is a _OL_NavigationFolderGet function but yet no _OL_NavigationFolderSet. If needed I will add such a function.

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

The following code works for me:

#include "..\OutlookEX.au3"
$oNamespace = $oOL.Application.GetNamespace("MAPI")
$oPane = $oOL.Application.ActiveExplorer.NavigationPane
$oModule = $oPane.Modules.GetNavigationModule(0)
$oGroup = $oModule.NavigationGroups.GetDefaultNavigationGroup(4)
$aFolder = _OL_FolderAccess($oOL, "*\Outlook-UDF-Test")
$oNavFolder = $oGroup.NavigationFolders()
$oNavFolder.Add($aFolder[1])

 

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

Glad you like the solution :)

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

Here is a little example how to access a search folder:

#include <OutlookEX.au3>

Global $oOL = _OL_Open()
Global $oNamespace = $oOL.GetNamespace("MAPI")
Global $oDefaultStore = $oNamespace.DefaultStore
Global $oSearchFolders = $oDefaultStore.GetSearchFolders
Global $oSearchFolder = $oSearchFolders("Unread Mails") ; Name of the search folder
;-------------------------------------
; Get all mails from the search folder
;-------------------------------------
Global $aItems = _OL_ItemFind($oOL, $oSearchFolder, $olMail, "", "", "", "Subject,Body")
_ArrayDisplay($aItems, "Unread mails")

BTW: The wiki explains how to access search folders as well :)

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 that's where I was reading about the search folders, and t hanks to your first example now get the search folder add working as well

Any Plans to get Outlookex added to Autoit as a standard UDF, think it would be a great add , as this UDF Totally Rocks!!!!

Edited by HighlanderSword
Link to comment
Share on other sites

We had a discussion some years ago about adding more UDFs to the AutoIt standard. As you can see there are tons of UDFs listed in the wiki. Which of them should be added to the standard?
To sum it up: No new UDFs will be added to the standard for now.
What I'm looking for would be to create a CHM file for UDFs like there is for AutoIt.

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

There will be a _OL_NavigationFolderSet in the - hopefully - near future :)

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

Hello,

I am an autoit noob and trying to use OutlookEX to send automated email that has an attachment.
Everything works fine if I have only 1 account configured in Outlook. _WinAPI_GetErrorMessage displays operation completed successfully and the mail is recieved on the other end.  However, if there are multiple accounts configured, my email just sits in draft @error is set to 6002 and following is returned when used _WinAPI_getErrorMessage something about "file is encrypted is received".


I figured it has something to do with choosing a profile to send an email rather than letting autoit decide which profile to use. I am having hard time figuring how to choose a profile/account to send an email using OutlookEx. Any help is greatly appreciated as this is the last bug in my knowledge to squish.
 

multiple accounts.png

single account.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...