Command-line edit of Word doc

  • Thread starter Thread starter kwinieck
  • Start date Start date
K

kwinieck

Is there a command-line tool that I can run to update a Word doc? I
want to replace one word "%Revision%" in a .doc file with a revision
number generated automatically by our version management tool (Serena
Version Manager).
 
Is there a command-line tool that I can run to update a Word doc? I
want to replace one word "%Revision%" in a .doc file with a revision
number generated automatically by our version management tool (Serena
Version Manager).
No, there are no commandline switches that will perform actions in a
document. You'd need to automate Word, open the document and make the
changes.

If the files were saved in RTF or HTML format you could conceivably
write a program that could parse and edit the content without opening
the file in WORD.

Another possibility would be to create a document property to contain
the Revision information. Use DocProperty fields to display it
throughout the document. Then, using dsofile.exe, a program could
change the document property without opening the file in Word.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
 
Thanks for the idea about properties and dsofile.exe. I searched google
for dsofile.exe, but only found dsofile.dll. Where to get dsofile.exe?
I don't know how to program in Visual Basic, etc. to use a .dll.
Ken Winiecki
 
Thanks for the idea about properties and dsofile.exe. I searched google
for dsofile.exe, but only found dsofile.dll. Where to get dsofile.exe?
I don't know how to program in Visual Basic, etc. to use a .dll.
Ken Winiecki
 
I went to that gmayor site and searched for dsofile.exe with no match
found. I read through the downloads available with no .exe that appears
to be usable for changing .doc properties, or replacing a word in a
..doc with another. There is a section on running VisualBasic to create
a VisualBasic program that replaced one word with another, but I don't
have VisualBasic and have no interest in learning to program Visual
Basic.

Ken
 
The web page Suzanne referred you http://www.gmayor.com/batch_replace.htm to
on my web site contains a description on how to use Word's VBA macro
language to replace words in a batch of files. (VBA is included with Word).
There is no need to learn VBA as the code is provided and if you don't know
how to use such a listing then you can find that information on my web site
also http://www.gmayor.com/installing_macro.htm . I can confirm that there
is no reference to dsofile.exe on my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thanks for the idea about properties and dsofile.exe. I searched google
for dsofile.exe, but only found dsofile.dll. Where to get dsofile.exe?
I don't know how to program in Visual Basic, etc. to use a .dll.
See here, first (you need to scroll down)

http://support.microsoft.com/default.aspx?scid=kb;en-us;253338

And I think you'll find an article at word.mvps.org (by Jonathan West, as
I recall) about using it. It is a DLL, but you can use it via VBA (Word
macro), as well. But if you don't have any programming background, then
you're going to need to find (hire) someone to do it for you.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Graham: Thank you for the info. Assuming I can create the VBA macro in
Word, I don't know how to run that from the command line, i.e., it
would seem I still must open Word and run interactively. Any advice on
how to run it from command line?
 
Your message was appended to the wrong part of the thread, which will no
doubt confuse Cindy ;)
You can run the macro from the command line winword /mmacroname
Word will open to run the macro.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Hi Graham,
Your message was appended to the wrong part of the thread, which will no
doubt confuse Cindy ;)
It did <g> But I figured you'd probably see it and know what was meant!

Cindy Meister
 
Back
Top