AuroraDaveF Posted June 23, 2015 Share Posted June 23, 2015 Hi, my brain is absolutely swimming and I'm having no luck trying to get my head around AutoIt and VBA macros at the same time.I need AutoIt to detect when a/any file opens in MS Word 2010 opens and when it does, to click a button on the Word toolbar (that will run a macro that makes some changes to make the file compliant, saves the file and closes word).I have the Word macro done and tested. I plan to open a list of files in word using a simple DOS batch file. I've had no luck making AutoOpen work in Word macros, so I'm hoping Openit can help me out.I've not been able to work out how to make AutoIt to detect word has opened a file (as opposed to opened to just Document 1), or how to click the right bits of the toolbar. Worst case scenario I can use the location of the button and make sure Word always opens full screen. I think I can do that, but as I'm failing the other bits I'm not sure if I'm reading the data in the AutiIt window info either.So, to the experts. I'd like a script to detect that Word has opened a file, bring up the View toolbar, then click the button to trigger the macro. The batch file will then open the next file, repeat.Please help. Thanks Link to comment Share on other sites More sharing options...
water Posted June 23, 2015 Share Posted June 23, 2015 (edited) Welcome to Autoit and the forum!I would do the following:Check why the macro isn't being executed when the document is opened. There are lots of sites exactly describing how to to this (like this one).I suggest to use the Word UDF that comes with AutoIt if you need to automate Word from an external program Edited June 23, 2015 by water 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...
junkew Posted June 24, 2015 Share Posted June 24, 2015 Whats your endgoal. Sounds like you easier can do your whole solution in VBA macro and no need for batch file or autoit.http://www.vbaexpress.com/kb/getarticle.php?kb_id=76and then you should ask your question in a VBA forum FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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