Carol32 Posted December 11, 2013 Share Posted December 11, 2013 I want to launch MS Word, create a document, Save it, and then print it. I have written a script, until launching the print dialog, however I am unable to proceed after that. How do I choose the specific printer in the dialog box, AutoIt Window Info does not show any information for the controls within the Print dialog box. Also, I don't want to script using keyboard shortcuts, if I have to navigate to the Print option by using the control click commands, how do I do it. Run ("C:Program FilesMicrosoft OfficeOffice12WINWORD.EXE") WinWaitActive("Document1 - Microsoft Word") Send("This is a test document to print") Send("{F12}") WinWaitActive("Save As") Send("D:AutoitAutomationScripttest1") Send("!s") Send("^p") Kindly advice, I am a newbie to automation and want to understand how to best use AutoIt. Thanks Link to comment Share on other sites More sharing options...
markyrocks Posted December 11, 2013 Share Posted December 11, 2013 I'd try setting up the proper printer as default in your computer. That way you avoid that step completely. Just my 2c Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
water Posted December 11, 2013 Share Posted December 11, 2013 Welcome to AutoIt and the forum! AutoIt comes with an UDF (User Defined Functions Library) to interact with Word. Check the help file or try my enhanced Word UDF (for download see my signature). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Carol32 Posted December 12, 2013 Author Share Posted December 12, 2013 Thanks MVP. I have tried Word.au3. But my intention for wanting to use the print dialog is because I want to understand how to automate lists, buttons and other user controls. Using this know-how I want to proceed to automate testing custom created windows applications. 1) Why is the Autoit window not showing information for the list of printers available ? 2) Are there any restrictions on the identification of controls.? 3) Sample script that uses a lot of control identification. Thanks Link to comment Share on other sites More sharing options...
water Posted December 12, 2013 Share Posted December 12, 2013 Use the AutoIt Window Info tool to get the needed information (ControID, class ...) to automate the controls. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Carol32 Posted December 12, 2013 Author Share Posted December 12, 2013 I used the AutoIt window info tool.. however for the print dialog, it shows no information. I want to know why that happens. Link to comment Share on other sites More sharing options...
water Posted December 12, 2013 Share Posted December 12, 2013 AutoIt can't automate all kinds of windows/controls. If the Window Info Tool doesn't schow any content for the window/control then you can only use Send etc. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - 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