Jump to content

Help with Outlook object and GetSelectNamesDialog method


Go to solution Solved by jugador,

Recommended Posts

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
 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.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 (NEW 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

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

  • Solution

You can try this UDF True AutoIt multi-threading!
not tested 
so do reply if it work or not...... :D

#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

 

Link to comment
Share on other sites

Using the multi-thread, I was able to get it to work!

@jugadorI 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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...