GaryMN Posted August 16, 2012 Posted August 16, 2012 (edited) I have some long Word templates that require multiple changes to names, dates, amounts, and other specific entries. I would like to just open the Word template and go from there. It would be like find-and-replace except you could make a list of the find-replace pairs and then click GO somehow. I assume the autoit code would be housed under Tools/Macros. As a newbie, I understand that autoit will do this, but I cannot seem to get started. I cannot even seem to open a document using autoit or figure out what all those things are that were downloaded for autoit. All help greatly appreciated. Gary Edited August 16, 2012 by GaryMN
Moderators Melba23 Posted August 16, 2012 Moderators Posted August 16, 2012 GaryMN,Welcome to the AutoIt forum. We can all remember the feeling when we started coding! Believe me, it does pass with time - although you have to make an effort to learn as you go along. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here. They will give you a good grounding in AutoIt and then you should feel less lost. As to your immediate problem, I would suggest using FileRead to get the content of the Word Templates into a variable and then use StringReplace to change the contents. Give it a try and see how you get on - you know where we are if you run into difficulties. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Myicq Posted August 16, 2012 Posted August 16, 2012 GaryMN, there are quite a few examples in the help files directory on using MS Word, essentially using COM to "remote control" MS Word. For me, it's simpler if I first create the basic code to use in VBA. You can most times do this using the macro recorder. Then you just translate the completed VBA code to the COM syntax. It should be not-that-difficult, if you look closely at help file examples, and perhaps at the MSDN documentation. In your current example, I would create (named) bookmarks if possible, bookmarks can be either a position or a range. Sometimes when asking quesions here, it's a good idea to post example documents / code. Makes it simpler to help you. I am just a hobby programmer, and nothing great to publish right now.
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