Microsoft Office Word and Python (Win XP)

3lvss0809 at gmail.com 3lvss0809 at gmail.com
Sat Jan 9 10:12:18 EST 2010


Hi.
Im very new with python. I have got some answer on my issue to use
interop or COM ''plugins'' to access MS Word through python but i
don't even know what those two ''plugins'' are so I cannot use them.
What I want to do is the following:

I need the script that moves (only moves, not change or delete!)
entire (100% of the text) text from one .doc file to another. But its
not so easy as it sounds. The target .doc file is not the only one but
can be many of them. All the target .doc files are always in the same
folder (same path) but all of them don't have the same name. The .doc
file FROM where I want to move entire text is only one, always in the
same folder (same path) and always with the same file name.
Names of the target are only similar but as I have said before, not
the same. Here is the point of whole script:
Target .doc files have the names:
HD1.doc
HD2.doc
HD3.doc
HD4.doc
and so on

What I would like to have is moved the entire (but really all of the
text, must be 100% all) text into the .doc file with the highest ( ! )
number. The target .doc files will always start with ''HD'' and always
be similar to above examples.
It is possible that the doc file (target file) is only one, so only
HD1.doc. Therefore ''1'' is the maximum number and the text is moved
into this file.
Sometimes the target file is empty but usually won't be. If it won't
be then the text should be moved to the end of the text, into first
new line (no empty lines inbetween).
So for example in the target file which has the maximum number in its
name is the following text:

a
b
c

In the file from which I want to move the text is:

d

This means I need in the target file this:

a
b
c
d

Could someone tell me please how to do this?

Thank you.



More information about the Python-list mailing list