Word from command prompt?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to execute MS Word commands from the command prompt? If so how
is it done?

I'm wondering if I can convert Word docs to txt files from the command
prompt. I know it is possible from within the program, but was wondering if
there's a command line interface for it.

Thanks.
 
Using the /m switch (see http://support.microsoft.com/?kbid=210565) you can
run a macro or a built-in command that doesn't need any further information
(such as FilePrintDefault, which prints the document without displaying the
Print dialog).

Since saving any document in a specific format requires further information
(the format, directory, and filename to save to), you can't put that command
directly in the command line. If you write a macro to do the job, you can
run the macro from the command line.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Thanks. Also another question: is it possible to convert tabulated Word docs
to CSV files? e.g. I want a comma between each table cell in the CSV file.
 
Word doesn't have an export filter to CSV the way Excel does. If the
document contains a table and you want it to be comma-separated, you
can use the Table > Convert > Table to Text command inside the
document and tell it to separate the cell contents with commas. Then
save the document as a Plain Text (*.txt) file, and change the
extension to .CSV if desired.

It's probably easier to copy the table to the clipboard, paste it into
Excel, and save the resulting worksheet as a CSV file.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top