rsn Posted July 8, 2022 Posted July 8, 2022 Hi all, Is there a way to not have my AutoIt script pause when the last line of the following is run? It seems to behave like a MsgBox but I need it to not. $objOutlook = ObjCreate("Outlook.Application" ) $oDialog = $objOutlook.Session.GetSelectNamesDialog() $oDialog.Display rsn
water Posted July 8, 2022 Posted July 8, 2022 Not that I know of. You have to wait until the user has done his selection. 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
rsn Posted July 8, 2022 Author Posted July 8, 2022 (edited) Curses. I was hoping for some way to call that dialog asynchronously so that the script could do something/anything. Heck, even exiting would be workable under the circumstances. I thank you for the info, @water. I'm humbled that the author of the Outlook UDFs answered my little question. Peace and victory, rsn Edited July 11, 2022 by rsn
Solution jugador Posted July 8, 2022 Solution Posted July 8, 2022 You can try this UDF True AutoIt multi-threading!not tested so do reply if it work or not...... #include 'N.au3' NMain('main') Func main() Local $objOutlook = ObjCreate("Outlook.Application" ) If Not IsObj($objOutlook) Then Return ConsoleWrite("> Outlook.Application failed" & @CRLF) Local $o_ThreadA = NLocal() $o_ThreadA.Obj = $objOutlook NRun('task', $o_ThreadA) Sleep(100) ;.... ;.... Endfunc Func task($o_Obj) ConsoleWrite("> ThreadA started" & @CRLF) Local $o_Object = $o_Obj.Obj Local $oDialog = $o_Object.Session.GetSelectNamesDialog() $oDialog.Display ;.... ;.... Endfunc
rsn Posted July 8, 2022 Author Posted July 8, 2022 Using the multi-thread, I was able to get it to work! @jugador: I wasn't able to use your code as written but after moving stuff around I came up with the minimum viable code below: #include <N.au3> NMain("main") Func main() $t = NRun("task") WinWait("Select Names:") ;... Endfunc Func task( ) $objOutlook = ObjCreate("Outlook.Application") $oDialog = $objOutlook.Session.GetSelectNamesDialog() $oDialog.Display Endfunc rsn
jugador Posted July 9, 2022 Posted July 9, 2022 I haven't used that UDF. anyway if my hint solve your requirement that's good. if @Jon / @jpm can comment on this UDF ( True AutoIt multi-threading! ) will be great .
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