pixelstudio Posted May 22, 2006 Share Posted May 22, 2006 hello people. i have the following situation. we have more then 100 .dot files (all containing the same VBA code) The code needs to be updated for all files. so i thought i'm gonna use AutoIT for this. Well this is what i got this far: reading directory, get all file names With a filename open Word in msword i send keys ALT-F11 , Ctrl-r, enter, password here i'm stuck what i got now is opening msword for a .dot file and then open the Visual basic editor (f11) then the Enter and password is for cause all the .dot files have a password on them. so ctrl-r focuses on the project window. ENTER selects the current project (enter password dialog appears) then i send password and ENTER to round that off Now what i need to do somehow select the correct module. select the whole function thats need to be updated and replace it with the new version. Please any help would be Great!! thanks in advance! Link to comment Share on other sites More sharing options...
blademonkey Posted May 22, 2006 Share Posted May 22, 2006 hello people.i have the following situation.we have more then 100 .dot files (all containing the same VBA code)The code needs to be updated for all files.so i thought i'm gonna use AutoIT for this.Well this is what i got this far:reading directory, get all file namesWith a filename open Wordin msword i send keys ALT-F11 , Ctrl-r, enter, passwordhere i'm stuckwhat i got now is opening msword for a .dot file and then open the Visual basic editor (f11)then the Enter and password is for cause all the .dot files have a password on them. so ctrl-r focuses on the project window.ENTER selects the current project (enter password dialog appears) then i send password and ENTER to round that offNow what i need to do somehow select the correct module. select the whole function thats need to be updated and replace it with the new version.Please any help would be Great!!thanks in advance!why can't you just replace the .dot file on all the PCs? ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Blue_Drache Posted May 22, 2006 Share Posted May 22, 2006 Impossible without using COM. Iffy even then. Modules are all .BAS files that have been saved in location:\foo\bar\file.bas right? Do you have to modify the documents or the modules?And is AutoIt the tool for the job? You could probably go around quite a bit of this headache and use Word to do it. You can send passwords and manipulate stuff within VBA. Check out this site and start hunting. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
pixelstudio Posted May 23, 2006 Author Share Posted May 23, 2006 Impossible without using COM. Iffy even then. Modules are all .BAS files that have been saved in location:\foo\bar\file.bas right? Do you have to modify the documents or the modules?And is AutoIt the tool for the job? You could probably go around quite a bit of this headache and use Word to do it. You can send passwords and manipulate stuff within VBA. Check out this site and start hunting.Lemme explain a bit.Replacing all .dot files is not going to work.i have more then 100 .dot files. all having a VBA module. that VBA module needs to be updated. by hand i would do :open .dot file, look for module/function. copy/past new function and save.that i need to be done for >100 files (guessing around 500 total files) so by hand it's loads of worktherefor i need to automate this.Using word/VBA i have tried. but it is impossible to automate WORD with VBA cause the projectfiles (modules) have a password. i cannot connect to this in any way!So i need to do this outside word. and therefor i asked my question about using AutoIT for this.hope this makes you understand cheers and thanks in advance Link to comment Share on other sites More sharing options...
RDSchaefer Posted May 24, 2006 Share Posted May 24, 2006 pixelstudio, How did you get all those files to the PCs in the first place? Can't you just make the change on your PC then copy ALL the files out again?RalphLemme explain a bit.Replacing all .dot files is not going to work.i have more then 100 .dot files. all having a VBA module. that VBA module needs to be updated. by hand i would do :open .dot file, look for module/function. copy/past new function and save.that i need to be done for >100 files (guessing around 500 total files) so by hand it's loads of worktherefor i need to automate this.Using word/VBA i have tried. but it is impossible to automate WORD with VBA cause the projectfiles (modules) have a password. i cannot connect to this in any way!So i need to do this outside word. and therefor i asked my question about using AutoIT for this.hope this makes you understand cheers and thanks in advance 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