megashape Posted November 21, 2017 Share Posted November 21, 2017 Hi there, I wanted to ask for general guidelines to help me understand how to create a script with AutoIT with my specific example. I have a mail merge that I need to run in Word Office and at the end, it triggers hundreds of file conversion windows on which I have to click OK in every single one. I'm sure this can be easily automated but I have no experience with AutoIT just some basic JS, could you please guide me at the right tutorials or explain the logic to me? Thank you. Link to comment Share on other sites More sharing options...
Earthshine Posted November 21, 2017 Share Posted November 21, 2017 (edited) Word and all office apps have VBA built in and it can EASILY do this. Private Sub Document_Open() DoMailMerge End Sub Public Sub DoMailMerge() Dim DocName$ DocName = ActiveDocument.Name 'Do mailmerge With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .Execute End With 'Close mailmerge document Windows(DocName).Close wdDoNotSaveChanges End Sub http://www.vbaexpress.com/kb/getarticle.php?kb_id=122 Copy the code above. Open the MailMerge document. Hit Alt+F11 to open the Visual Basic Editor. Double-click Project Normal at the left. Choose Insert-Module, and paste the Public Sub code into the window at the right. Hit the Save diskette button and close the VBE. Double-click the MailMerge Project at the left. Double-click MicrosoftWordObjects. Double-click ThisDocument Paste the Private Sub code into the window at the right. Hit the Save diskette button and close the VBE. To edit the document or the code, hold down Shift when opening the document to prevent the macro from running Test the code: Close and reopen the mailmerge document. A new FormLetters document should be created containing the merged information if you just have to use AutoIt to click the buttons you can do that using the Send command pretty easily enough though. Use the AutoIt Info Tool to get the button you want to press and we can help. Edited November 21, 2017 by Earthshine My resources are limited. You must ask the right questions 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