JailDoctor Posted May 1, 2013 Share Posted May 1, 2013 The msgbox example I listed as working is not for AutoIt, but for Visual Basic for Apps (VBA),and it works just fine. I need the AutoIt version of the same thing. Link to comment Share on other sites More sharing options...
water Posted May 1, 2013 Share Posted May 1, 2013 Error message:==> The requested action with this object has failed.:$sAccount = $oAccount.Getnamespace("MAPI").CurrentUser.Name$sAccount = $oAccount.Getnamespace("MAPI")^ ERRORDid you try my short code example? You need to run it with the Outlook application object as returned by _OL_Open, not the account object as in your example. 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 More sharing options...
JailDoctor Posted May 2, 2013 Share Posted May 2, 2013 Ok, so this is what I have and I still don't get it. #include <OutlookEX.au3> $oOutlook = _OL_Open(True) MsgBox (0, "", $oOutlook.Getnamespace("MAPI").CurrentUser.Name) $oOutlook = _OL_Open(False) I get this error: => Object referenced outside a "With" statement.: MsgBox (0, "", $oOutlook.Getnamespace("MAPI").CurrentUser.Name) MsgBox (0, "", $oOutlook.Getnamespace("MAPI")^ ERROR ->09:34:03 AutoIT3.exe ended.rc:1 Link to comment Share on other sites More sharing options...
water Posted May 2, 2013 Share Posted May 2, 2013 Looks like a problem mit MAPI. Another try: #include <OutlookEX.au3> _OL_ErrorNotify(2) $oOutlook = _OL_Open(True) $oNS = $oOutlook.Getnamespace("MAPI") $oCU = $oNS.CurrentUser $sName = $oCU.Name MsgBox (0, "", $sName) $oOutlook = _OL_Close($oOutlook) 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 More sharing options...
JailDoctor Posted May 2, 2013 Share Posted May 2, 2013 It seems it is something with MAPI: : ==> Error in expression.: $oNS = $oOutlook.Getnamespace("MAPI") $oNS = ^ ERROR ->11:40:05 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 2.119 Link to comment Share on other sites More sharing options...
water Posted May 2, 2013 Share Posted May 2, 2013 Do you connect to an Exchange server with your Outlook client? 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 More sharing options...
JailDoctor Posted May 3, 2013 Share Posted May 3, 2013 Yes, I do. Link to comment Share on other sites More sharing options...
water Posted May 3, 2013 Share Posted May 3, 2013 Did you run my example from post #64? It shouldn't crash but give a MsgBox with complete COM error information. 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 More sharing options...
JailDoctor Posted May 6, 2013 Share Posted May 6, 2013 Yes and I got the error posted in #65 Link to comment Share on other sites More sharing options...
water Posted May 6, 2013 Share Posted May 6, 2013 I don't get it. My code in post #64 creates a COM error handler so the script shouldn't crash any longer. Let's add some more error checking: #include <OutlookEX.au3> _OL_ErrorNotify(2) If @error then Exit Msgbox(0, "Error", "Error returned by _OL_ErrorNotify: @error = " & @error & ", @extended = " & @extended) $oOutlook = _OL_Open(True) If @error then Exit Msgbox(0, "Error", "Error returned by _OL_Open: @error = " & @error & ", @extended = " & @extended) $oNS = $oOutlook.Getnamespace("MAPI") $oCU = $oNS.CurrentUser $sName = $oCU.Name MsgBox (0, "", $sName) $oOutlook = _OL_Close($oOutlook) 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 More sharing options...
JailDoctor Posted May 7, 2013 Share Posted May 7, 2013 Here is the error message: Error returned by _OL_Open: @error = 5, @extended =0 ??? What is @error 5 and @extended 0? Link to comment Share on other sites More sharing options...
water Posted May 7, 2013 Share Posted May 7, 2013 Check the help file for _OL_Open or have a look at the function header in OutlookEX.au3: 5 - File $sWarningProgram does not exist. Has to be an executable that can be startet using the run command With $oOutlook = _OL_Open(True)you tell the function to use the @ScriptDir & "\_OL_Warnings.exe". This program can't be found. Try to use$oOutlook = _OL_Open() 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 More sharing options...
JailDoctor Posted May 8, 2013 Share Posted May 8, 2013 That was it Water, thanks.I checked my "Autoit3" folders and there was no "_OL_Warnings.exe" file. So leaving the () blank did the trick.Thanks again. Link to comment Share on other sites More sharing options...
water Posted May 8, 2013 Share Posted May 8, 2013 Glad your 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now