dd2010 Posted November 9, 2010 Posted November 9, 2010 Hi, This is my first forum entry, so go easy on me haha. I think the easiest way to do this is going to be to explain my situation. --Okay, so I use an MDaemon 2.2 Outlook connector when setting up a new outlook session on a computer/setting the user up to view their e-mail. I was wondering if anyone knows a way to have AutoIt go in to AD and query with the user's logon information then have that information pulled about that user to fill in the sections needed after selecting the connector when setting up outlook. These fields would be: Your name, Organization, E-mail address, and the logon information. The script I envisioned would have to pause to allow the user to type in their password. I'm not sure how this can be done. If anyone has any suggestions, any at all even if they do something different then what I wrote above but does the same basic idea, I'm open for anything. Thank you!
water Posted November 9, 2010 Posted November 9, 2010 (edited) To connect to AD use the AD UDF (for download please see my signature). A script could look like: #include <ad.au3> _AD_Open() ; Use the credentials of the current user $sName = _AD_GetObjectAttribute(@UserName,"Displayname") $sMail = _AD_GetObjectAttribute(@UserName,"mail") ; Organization: Don't know how to grab from AD ; logon information = @username _AD_Close() Edited November 9, 2010 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
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 Thank you! I will try it out, I appreciate it and the quick response!!
water Posted November 9, 2010 Posted November 9, 2010 (edited) To get a look at all available attributes (to find out where to look for the company name) please run example script _AD_GetObjectProperties. Edited November 9, 2010 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
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 yeah, I've been taking a look at those au3 files... I love the AD_GetObjectProperties one, however, I'm stuck at a point now where I guess I don't know how I'm going to get that information that gets pulled from: $sName = _AD_GetObjectAttribute(@UserName, "Displayname") $sMail = _AD_GetObjectAttribute(@UserName, "E-mail") $sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization: ...into the fields of Outlook when the script comes to that point- (i added the window i want the information to go into in the attachment). My other issue being when adding: #include <ad.au3> _AD_Open() ; Use the credentials of the current user $sName = _AD_GetObjectAttribute(@UserName, "Displayname") $sMail = _AD_GetObjectAttribute(@UserName, "E-mail") $sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization: ; logon information = @username _AD_Close() ..to my script, even by itself not added into my ongoing script nothing comes up like in the example AD au3 files. I don't know what I'm missing to make that information pop up, I've tried adding key lines from the examples that make them run and I still get nothing. I know I'm missing something that is key, but, I have no idea what it is. any help is greatly appreciated! thank you!
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 This is what I have in my script so far:#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Script Function: Outlook User Setup Automation #ce ----------------------------------------------------------------------------#Region ---Au3Recorder generated code Start ---Opt("WinWaitDelay", 100)Opt("WinDetectHiddenText", 1)Opt("MouseCoordMode", 0)_WinWaitActivate("Start menu", "")MouseClick("left", 32, 489, 1)Send("outlook{ENTER}")_WinWaitActivate("Outlook 2007 Startup", "")MouseClick("left", 474, 444, 1)_WinWaitActivate("Account Configuration", "")MouseClick("left", 474, 444, 1)_WinWaitActivate("Add New E-mail Account", "")MouseClick("left", 87, 393, 1)MouseClick("left", 486, 449, 1)MouseClick("left", 106, 198, 1)MouseClick("left", 467, 439, 1)#Region --- Internal functions Au3Recorder Start ---Func _WinWaitActivate($title, $text, $timeout = 0) WinWait($title, $text, $timeout) If Not WinActive($title, $text) Then WinActivate($title, $text) WinWaitActive($title, $text, $timeout)EndFunc ;==>_WinWaitActivate#EndRegion --- Internal functions Au3Recorder Start ---#EndRegion ---Au3Recorder generated code Start ---#include <ad.au3>_AD_Open() ; Use the credentials of the current userGlobal $sName, $sMail, $sCompany$sName = _AD_GetObjectAttribute(@UserName, "Displayname")$sMail = _AD_GetObjectAttribute(@UserName, "mail")$sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization:; logon information = @username_AD_Close()
water Posted November 9, 2010 Posted November 9, 2010 To display the information of the AD functions please use something like: #include <ad.au3> _AD_Open() ; Use the credentials of the current user $sName = _AD_GetObjectAttribute(@UserName, "Displayname") $sMail = _AD_GetObjectAttribute(@UserName, "E-mail") $sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization: ConsoleWrite("Username: " & $sName & @CRLF) ConsoleWrite("E-Mail: " & $sMail & @CRLF) ConsoleWrite("Company: " & $sCompany & @CRLF) _AD_Close() If the information you get is correct then we can proceed to the next step Use the AutoIt Window Info Tool to get the ControlId of the three input fields of the MDaemon Connector. I have to think about the next step ... 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
water Posted November 9, 2010 Posted November 9, 2010 When you have the ControlId use $iResult = ControlSend("Outlook Connector for MDaemon 2.2","", <Your ControlID>, "Test") ConsoleWrite($iResult & "-" & @error & @CRLF) to set a value and check the result for errors. 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
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 i didn't realize i could utilize the info tool with this one. how i would utilize it? well, that's going to be a challenge for me as well lol. Did I mention that the first time I used autoit was yesterday haha. So i finally got some output from:#include <ad.au3>_AD_Open() ; Use the credentials of the current user$sName = _AD_GetObjectAttribute(@UserName, "Displayname")$sMail = _AD_GetObjectAttribute(@UserName, "mail")$sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization:ConsoleWrite("Username: " & $sName & @CRLF)ConsoleWrite("Mail: " & $sMail & @CRLF)ConsoleWrite("Company: " & $sCompany & @CRLF)_AD_Close()...however, I only got the Displayname nothing else: (below is the output)>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\test.user\Downloads\dcb.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams +>11:48:49 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X64)>Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3+>11:48:49 AU3Check ended.rc:0>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\test.user\Downloads\dcb.au3" Username: Test UserMail: Company: +>11:48:49 AutoIT3.exe ended.rc:0>Exit code: 0 Time: 1.523... I noticed that where I want to get the company name from (AD_GetObjectProperties) displays the information as an array and with ConsoleWrite it just displays the output in the pane below the script. I tried changing a few things but I still can't get the field to show the data but in the array table it does show the company name. I don't know if the e-mail one isn't showing up maybe because the field is named differently in AD or if we have e-mail addresses listed somewhere else in AD, I can't access AD right now because my supervisor is at another location. The other thing I just realized is the Test User which is the account I currently have to use may not have an e-mail address set up which could be why it's showing up blank, makes sense right? haha. The company thing is the only thing stumping me, I'll have to check about the e-mail thing but I think that is probably what it is. Again, I can't thank you enough for helping me, I probably would never have been able to get this far
water Posted November 9, 2010 Posted November 9, 2010 (edited) ...however, I only got the Displayname nothing else: (below is the output) Let's see if you get an error: #include <ad.au3> _AD_Open() ; Use the credentials of the current user $sName = _AD_GetObjectAttribute(@UserName, "Displayname") ConsoleWrite("Error: " & @error & " Username: " & $sName & @CRLF) $sMail = _AD_GetObjectAttribute(@UserName, "mail") ConsoleWrite("Error: " & @error & " Mail: " & $sMail & @CRLF) $sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization: ConsoleWrite("Error: " & @error & " Company: " & $sCompany & @CRLF) _AD_Close() Edited November 9, 2010 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
water Posted November 9, 2010 Posted November 9, 2010 To use the Window Info Tool click on the "Control" Tab then just move the crosshair icon (Finder Tool) over the input field of the MDaemon Connector. The number displayed for the ID property is what you need. 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
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 this is the output I recieved:>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\test.user\Downloads\testing.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams +>12:22:49 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X64)>Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3+>12:22:49 AU3Check ended.rc:0>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\test.user\Downloads\testing.au3" Error: 0 Username: Test UserError: 2 Mail: Error: 0 Company: +>12:22:49 AutoIT3.exe ended.rc:0>Exit code: 0 Time: 1.526and when you say i just need the id for the MDaemon connector do you mean when I'm looking at the screen shot that i posted before with all the input fields of: "Your name, Organization. E-mail Address" or the step before that when you select the other radio button for the e-mail service then highlight the MDaemon connector?
water Posted November 9, 2010 Posted November 9, 2010 (edited) Error 2 means: Attribute does not exist for the userOur test users are stripped down users with no mail account etc. So I would suggest to test it for a real user. Specify whatever user you like as parameter 1 for _AD_GetObjectAttribute.To get the ID of the 3 controls do:start the Window Info Toolclick on the control tabmove the crosshair icon to the first input field of the user information (MDaemon window)note the ID numbermove the crosshair icon to the second input field of the user information (MDaemon window)note the ID numbermove the crosshair icon to the third input field of the user information (MDaemon window)note the ID numberclose everything Edited November 9, 2010 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
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 I can't test it on another user yet, I don't have privileges yet, I don't even have my own user account yet. But I will test it. I figured out the company part... I was using AD_GetObjectProperties when i should have been using AD_GetObjectAttribute. As soon as i changed: $sCompany = _AD_GetObjectProperties(@UserName, "company"); Organization:to$sCompany = _AD_GetObjectAttribute(@UserName, "company"); Organization:it displayed the company name... now, I just have to do the whole taking the output from those commands and getting it to populate in the fields of the GUI. Which is where the info tool comes into play and I can get the ID but what to do after that. With the lines:$iResult = ControlSend("Outlook Connector for MDaemon 2.2", "", <430 >, "Test")ConsoleWrite($iResult & "-" & @error & @CRLF)i get errors...C:\Users\test.user\Downloads\OutlookAutomation11-8-2010.au3(47,65) : ERROR: syntax error$iResult = ControlSend("Outlook Connector for MDaemon 2.2", "", <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^C:\Users\test.user\Downloads\OutlookAutomation11-8-2010.au3(47,71) : ERROR: syntax error$iResult = ControlSend("Outlook Connector for MDaemon 2.2", "", <430>,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^C:\Users\test.user\Downloads\OutlookAutomation11-8-2010.au3 - 2 error(s), 0 warning(s) ... The ID that is in the error <430> is the ID when I select the MDaemon connector link on the page of the setup that says: "Choose E-mail Service" then I click the other radio button and select the MDaemon link. The IDs on the part of the setup for outlook after selecting the MDaemon connector are:ID for Your name field: 1022ID for organization field: 1024ID for e-mail field: 1026ID for the User Info group which all of the above are placed under is: 1021... are these the IDs that i should be implementing into my script?thank you
dd2010 Posted November 9, 2010 Author Posted November 9, 2010 oops, sorry did not see the part of your post that told me the IDs to get.
water Posted November 10, 2010 Posted November 10, 2010 Sorry, I was a bit unclear in my post regarding the ControlID. You have to write them without braces. So the correct statement looks like: $iResult = ControlSend("Outlook Connector for MDaemon 2.2", "", 430 , "Test") 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
dd2010 Posted November 10, 2010 Author Posted November 10, 2010 I did eventually take the brackets out after viewing the help file, thank you though... This is the output I recieved:>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\test.user\Outlook AutoIt 11-2010\OutlookAutomation11-8-2010.au3" Your name: Test UserOrganization: TAAE-mail Address: 1-0+>08:24:21 AutoIT3.exe ended.rc:0>Exit code: 0 Time: 6.530... I tried looking up what the 1-0 meant but found no luck. If I follow the syntax the 1 correlates with the $iResult I believe and the 0 must mean there are no errors... So, I guess now I'm curious as to what the 1 indicates. Also, I was trying a couple of functions to try and get the text to populate in the text box but no luck. However, I did use one function where I was able to change the "Your name:" text to the "Test" text and I can't remember which one it was. I also tried to use this function:ControlClick("Outlook Connector for MDaemon 2.2", "Your Name:", 1022 , "middle", 1, 39, 9)... no luck, the script runs and then gets to the screen where it would fill in the information, beeps and then writes the information in the bottom pane below the script.
dd2010 Posted November 10, 2010 Author Posted November 10, 2010 okay so I added these two line at the bottom of my script and got the "Your Name:" part to populate the correct information. Now, I need to find out how to populate the rest of the information in their appropriate places. Any ideas?#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Script Function: Outlook User Setup Automation #ce ----------------------------------------------------------------------------BlockInput(1)#Region ---Au3Recorder generated code Start ---Opt("WinWaitDelay", 100)Opt("WinDetectHiddenText", 1)Opt("MouseCoordMode", 0)_WinWaitActivate("Start menu", "")MouseClick("left", 24, 499, 1)Send("out{ENTER}")_WinWaitActivate("Outlook 2007 Startup", "")MouseClick("left", 473, 443, 1)_WinWaitActivate("Account Configuration", "")MouseClick("left", 473, 443, 1)_WinWaitActivate("Add New E-mail Account", "")MouseClick("left", 244, 390, 1)MouseClick("left", 512, 443, 1)MouseClick("left", 101, 194, 1)MouseClick("left", 480, 447, 1)#Region --- Internal functions Au3Recorder Start ---Func _WinWaitActivate($title, $text, $timeout = 0) WinWait($title, $text, $timeout) If Not WinActive($title, $text) Then WinActivate($title, $text) WinWaitActive($title, $text, $timeout)EndFunc ;==>_WinWaitActivate#EndRegion --- Internal functions Au3Recorder Start ---#EndRegion ---Au3Recorder generated code Start ---#include <ad.au3>_AD_Open() ; Use the credentials of the current user$sName = _AD_GetObjectAttribute(@UserName, "Displayname"); Username$sMail = _AD_GetObjectAttribute(@UserName, "Mail"); User E-mail Address$sCompany = _AD_GetObjectAttribute(@UserName, "Company"); OrganizationConsoleWrite("Your name: " & $sName & @CRLF)ConsoleWrite("Organization: " & $sCompany & @CRLF)ConsoleWrite("E-mail Address: " & $sMail & @CRLF)$iResult = ControlSend("Outlook Connector for MDaemon 2.2", "Your Name:", 1022, $sName)ConsoleWrite($iResult & "-" & @error & @CRLF)_AD_Close()WinWaitActive("Outlook Connector for MDaemon 2.2", "")Send($sName)
water Posted November 10, 2010 Posted November 10, 2010 ... I tried looking up what the 1-0 meant but found no luck. If I follow the syntax the 1 correlates with the $iResult I believe and the 0 must mean there are no errors... So, I guess now I'm curious as to what the 1 indicates. 1-0 is the returncode plus error code of function ControlSend. Most AutoIT functions return 1 on success. If another value denotes an error the @error is set to indicate what happend. So in your case it means: Everything is fine! The bottom pane is the SciTE Console where the output of ConsoleWrite statements are displayed. According to the ControlIDs you specified in post #14 your code should look like: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Script Function: Outlook User Setup Automation #ce ---------------------------------------------------------------------------- BlockInput(1) #Region ---Au3Recorder generated code Start --- Opt("WinWaitDelay", 100) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 0) _WinWaitActivate("Start menu", "") MouseClick("left", 24, 499, 1) Send("out{ENTER}") _WinWaitActivate("Outlook 2007 Startup", "") MouseClick("left", 473, 443, 1) _WinWaitActivate("Account Configuration", "") MouseClick("left", 473, 443, 1) _WinWaitActivate("Add New E-mail Account", "") MouseClick("left", 244, 390, 1) MouseClick("left", 512, 443, 1) MouseClick("left", 101, 194, 1) MouseClick("left", 480, 447, 1) #Region --- Internal functions Au3Recorder Start --- Func _WinWaitActivate($title, $text, $timeout = 0) WinWait($title, $text, $timeout) If Not WinActive($title, $text) Then WinActivate($title, $text) WinWaitActive($title, $text, $timeout) EndFunc ;==>_WinWaitActivate #EndRegion --- Internal functions Au3Recorder Start --- #EndRegion ---Au3Recorder generated code Start --- #include <ad.au3> _AD_Open() ; Use the credentials of the current user $sName = _AD_GetObjectAttribute(@UserName, "Displayname"); Username $sMail = _AD_GetObjectAttribute(@UserName, "Mail"); User E-mail Address $sCompany = _AD_GetObjectAttribute(@UserName, "Company"); Organization $iResult = ControlSend("Outlook Connector for MDaemon 2.2", "Your Name:", 1022, $sName) if $iResult <> 1 then MsgBox(0,"","Error on ControlSend Name: Return value: " & $iResult & " @error: " & @error) $iResult = ControlSend("Outlook Connector for MDaemon 2.2", "Organization:", 1024, $sCompany) if $iResult <> 1 then MsgBox(0,"","Error on ControlSend Company: Return value: " & $iResult & " @error: " & @error) $iResult = ControlSend("Outlook Connector for MDaemon 2.2", "E-mail Address:", 1026, $sMail) if $iResult <> 1 then MsgBox(0,"","Error on ControlSend Mail: Return value: " & $iResult & " @error: " & @error) $iResult = ControlSend("Outlook Connector for MDaemon 2.2", "User Name:", 1021, @UserName) if $iResult <> 1 then MsgBox(0,"","Error on ControlSend Username: Return value: " & $iResult & " @error: " & @error) _AD_Close() 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
dd2010 Posted November 10, 2010 Author Posted November 10, 2010 so I don't know if this the best way to do this but after looking up some things I ended up getting the script to automate all the fields in the "Outlook Connector for MDaemon 2.2" window. This is what my script looks like now:BlockInput(1)#Region ---Au3Recorder generated code Start ---Opt("WinWaitDelay", 100)Opt("WinDetectHiddenText", 1)Opt("MouseCoordMode", 0)_WinWaitActivate("Start menu", "")MouseClick("left", 24, 499, 1)Send("out{ENTER}")_WinWaitActivate("Outlook 2007 Startup", "")MouseClick("left", 473, 443, 1)_WinWaitActivate("Account Configuration", "")MouseClick("left", 473, 443, 1)_WinWaitActivate("Add New E-mail Account", "")MouseClick("left", 244, 390, 1)MouseClick("left", 512, 443, 1)MouseClick("left", 101, 194, 1)MouseClick("left", 480, 447, 1)#Region --- Internal functions Au3Recorder Start ---Func _WinWaitActivate($title, $text, $timeout = 0) WinWait($title, $text, $timeout) If Not WinActive($title, $text) Then WinActivate($title, $text) WinWaitActive($title, $text, $timeout)EndFunc ;==>_WinWaitActivate#EndRegion --- Internal functions Au3Recorder Start ---#EndRegion ---Au3Recorder generated code Start ---#include <ad.au3>_AD_Open() ; Use the credentials of the current user$sName = _AD_GetObjectAttribute(@UserName, "Displayname"); Username$sMail = _AD_GetObjectAttribute(@UserName, "Mail"); User E-mail Address$sCompany = _AD_GetObjectAttribute(@UserName, "Company"); OrganizationConsoleWrite("Your name: " & $sName & @CRLF)ConsoleWrite("Organization: " & $sCompany & @CRLF)ConsoleWrite("E-mail Address: " & $sMail & @CRLF)_AD_Close()ControlSend("Outlook Connector for MDaemon 2.2", "Your Name:", 1022, $sName)WinWaitActive("Outlook Connector for MDaemon 2.2", "")Send($sName)Send("{TAB}")Send($sCompany)Send("{TAB}")Send($sMail)Send("{TAB}")Send("Outlook Connector")Send("{TAB}")Send("po")Send("{TAB}")Send("po")Send("{TAB}")Send($sMail)Send("{TAB}")...in orange is the new functions I added to get all the information to populateBut yet again I am going to be stuck because now the last field I have to populate is the password for the logon. Is there a way to have the script prompt the user for their password and then populate the given password into the field?Thank you for all of your help!
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