Sign in to follow this  
Followers 0
sol2011

opening word files/sending keys to word/ iterating

3 posts in this topic

Hi.

First post. Autoit seems like it can do what we need, but I'm not quite sure. Any advice welcome.

All we need is

-to open the first Word file in a folder (I've managed to do that for a specific file with WordDocOpen; not sure yet how to do the first file)

-send tabs to tab through fields and then a space to check a box

-save, close (send shift+f12/alt+f4)

-open the second Word file, repeat the above, and go through all the word documents in the folder in the same way

include <Word.au3>

$oWordApp = _WordCreate ("")

$oDoc = _WordDocOpen ($oWordApp, @ScriptDir & "\filename.doc"

///send commands///

Obviously, I'm missing a lot here, and have epic amounts to learn.

I hardly know anything about programming, but thanks to the UDF I've managed to at least get what we need with one specific document in the folder (check the box, save and close). (By the way, do I need $oWordApp = _WordCreate ("") to make this work."

How do I (or what commands should I be looking at in the vast help file) to do the following

1. Work on the first file of the directory, not one I specify (just putting in "/*.*" didn't do it.

2. Repeat for each word document in the folder.

Suggestions, advice, pointers greatly appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

First, if the word files are already created, you do not need to use _WordCreate.

Now, I have a question. Are all the word files exactly the same? Will you need to do the exact same things to every single document? If so, I suggest downloading SciTE4AutoIt3. It has a something called ScriptWriter. You can use it to record all the tabs & spaces you want to program. It will generate the basic script for you. Once you get that part, you can start tackling the more difficult part of making it do that to all the files.

Also, how many files are you talking about? Is this just a one time thing or do you need to make a useful, permanent script?

Edited by sleepydvdr

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Thanks for replying.

Yes. The files are the same, at least up to the part of the box that needs to be checked. The exact same box on the exact same page (following the exact same number of fields) needs to be checked.

I'll try out the ScriptWriter. I've got my basic creation to do what I want on a single (specified) file, but maybe ScriptWriter will come up with a better script.

As for the files, we're talking a lot, 800 to 1000 Word documents (in the same directory), and I would need to be able to do it again on another batch of the same later.

Cheers.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0