G
Guest
Is there a way to run WORD from DOS?
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD command
(i.e.: count the number of words in the document, etc.). I guess a
generic command at the DOS prompt would look something like the
following: winword.exe <name of document to be loaded> [<command
options>]
I hope I'm making better sense.
Suzanne S. Barnhill said:Are you asking whether it is possible to edit in a later version of
Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Jay Freedman said:Hi Bee,
Yes, depending on what command you want to run, that may be possible.
For the specific example of a word count, you could run this command line:
winword.exe "c:\docs\MyDocument.doc" /mToolsWordCount
The help (or, in expanded form, http://support.microsoft.com/?kbid=210565)
describes the last part of that command as the "/mmacroname" switch, and it
will indeed work with macros stored in the Normal.dot template. For your
purposes, though, "macroname" also includes all the built-in Word commands.
To find the names that can be used in the switch, open the Macros dialog
(Alt+F8) and set the Macros In dropdown to "Word commands".
I think you confused the issue a bit by referring to "the DOS version". Some
of us remember Word for DOS and thought that's what you meant. Anyway, in
current versions of Windows the command processor isn't DOS, even though it
responds to most of the same syntax.
--
Regards,
Jay Freedman
Microsoft Word MVP
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD command
(i.e.: count the number of words in the document, etc.). I guess a
generic command at the DOS prompt would look something like the
following: winword.exe <name of document to be loaded> [<command
options>]
I hope I'm making better sense.
Suzanne S. Barnhill said:Are you asking whether it is possible to edit in a later version of
Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Thanks. Is there a way to also load up a file a WORD document in
the DOS version? To take it a step further, how about load up a
WORD document and invoking some attributes like line numbering,
etc.?
:
Only if it's a DOS version.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Is there a way to run WORD from DOS?
Hey, Jay. I found what you said to be incredibly helpful. It suits my
purposes almost perfectly. I looked at the list of built-in WORD commands and
I couldn't find a macro (command) that inserts line numbers. Suggestions?
Jay Freedman said:Hi Bee,
Yes, depending on what command you want to run, that may be possible.
For the specific example of a word count, you could run this command line:
winword.exe "c:\docs\MyDocument.doc" /mToolsWordCount
The help (or, in expanded form, http://support.microsoft.com/?kbid=210565)
describes the last part of that command as the "/mmacroname" switch, and it
will indeed work with macros stored in the Normal.dot template. For your
purposes, though, "macroname" also includes all the built-in Word commands.
To find the names that can be used in the switch, open the Macros dialog
(Alt+F8) and set the Macros In dropdown to "Word commands".
I think you confused the issue a bit by referring to "the DOS version". Some
of us remember Word for DOS and thought that's what you meant. Anyway, in
current versions of Windows the command processor isn't DOS, even though it
responds to most of the same syntax.
--
Regards,
Jay Freedman
Microsoft Word MVP
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD command
(i.e.: count the number of words in the document, etc.). I guess a
generic command at the DOS prompt would look something like the
following: winword.exe <name of document to be loaded> [<command
options>]
I hope I'm making better sense.
:
Are you asking whether it is possible to edit in a later version of
Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Thanks. Is there a way to also load up a file a WORD document in
the DOS version? To take it a step further, how about load up a
WORD document and invoking some attributes like line numbering,
etc.?
:
Only if it's a DOS version.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Is there a way to run WORD from DOS?
Jay Freedman said:There isn't any built-in command for line numbers, but you can put
this macro into Normal.dot (see
http://www.gmayor.com/installing_macro.htm):
Public Sub LineNums()
ActiveDocument.PageSetup.LineNumbering.Active = True
End Sub
Then use the command line
winword.exe "c:\docs\MyDocument.doc" /mLineNums
to number the document when it opens.
--
Regards,
Jay Freedman
Microsoft Word MVP
Hey, Jay. I found what you said to be incredibly helpful. It suits my
purposes almost perfectly. I looked at the list of built-in WORD commands and
I couldn't find a macro (command) that inserts line numbers. Suggestions?
Jay Freedman said:Hi Bee,
Yes, depending on what command you want to run, that may be possible.
For the specific example of a word count, you could run this command line:
winword.exe "c:\docs\MyDocument.doc" /mToolsWordCount
The help (or, in expanded form, http://support.microsoft.com/?kbid=210565)
describes the last part of that command as the "/mmacroname" switch, and it
will indeed work with macros stored in the Normal.dot template. For your
purposes, though, "macroname" also includes all the built-in Word commands.
To find the names that can be used in the switch, open the Macros dialog
(Alt+F8) and set the Macros In dropdown to "Word commands".
I think you confused the issue a bit by referring to "the DOS version". Some
of us remember Word for DOS and thought that's what you meant. Anyway, in
current versions of Windows the command processor isn't DOS, even though it
responds to most of the same syntax.
--
Regards,
Jay Freedman
Microsoft Word MVP
Bee wrote:
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD command
(i.e.: count the number of words in the document, etc.). I guess a
generic command at the DOS prompt would look something like the
following: winword.exe <name of document to be loaded> [<command
options>]
I hope I'm making better sense.
:
Are you asking whether it is possible to edit in a later version of
Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Thanks. Is there a way to also load up a file a WORD document in
the DOS version? To take it a step further, how about load up a
WORD document and invoking some attributes like line numbering,
etc.?
:
Only if it's a DOS version.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Is there a way to run WORD from DOS?
Your solution worked perfectly, Jay. Thanks so much. I would like to
add one more thing. I would like to insert page numbers. I used the
InsertPageNumbers macro (e.g.: /mInsertPageNumbers). When I do that,
my document opens up (as expected) but then I get an additional
window (called Page Numbers) that asks me for the format for the page
numbering. That's expected I guess. My question now is... Could I use
the InsertPageNumbers macro (along with parameter values?) or create
another macro where the page numbering would default to parameter of
my coded choosing (i.e.: number pages at the bottom right)?
Jay Freedman said:There isn't any built-in command for line numbers, but you can put
this macro into Normal.dot (see
http://www.gmayor.com/installing_macro.htm):
Public Sub LineNums()
ActiveDocument.PageSetup.LineNumbering.Active = True
End Sub
Then use the command line
winword.exe "c:\docs\MyDocument.doc" /mLineNums
to number the document when it opens.
--
Regards,
Jay Freedman
Microsoft Word MVP
Hey, Jay. I found what you said to be incredibly helpful. It suits
my purposes almost perfectly. I looked at the list of built-in WORD
commands and I couldn't find a macro (command) that inserts line
numbers. Suggestions?
:
Hi Bee,
Yes, depending on what command you want to run, that may be
possible.
For the specific example of a word count, you could run this
command line:
winword.exe "c:\docs\MyDocument.doc" /mToolsWordCount
The help (or, in expanded form,
http://support.microsoft.com/?kbid=210565) describes the last part
of that command as the "/mmacroname" switch, and it will indeed
work with macros stored in the Normal.dot template. For your
purposes, though, "macroname" also includes all the built-in Word
commands. To find the names that can be used in the switch, open
the Macros dialog (Alt+F8) and set the Macros In dropdown to "Word
commands".
I think you confused the issue a bit by referring to "the DOS
version". Some of us remember Word for DOS and thought that's what
you meant. Anyway, in current versions of Windows the command
processor isn't DOS, even though it responds to most of the same
syntax.
--
Regards,
Jay Freedman
Microsoft Word MVP
Bee wrote:
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD
command (i.e.: count the number of words in the document, etc.).
I guess a generic command at the DOS prompt would look something
like the following: winword.exe <name of document to be loaded>
[<command options>]
I hope I'm making better sense.
:
Are you asking whether it is possible to edit in a later version
of Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Thanks. Is there a way to also load up a file a WORD document in
the DOS version? To take it a step further, how about load up a
WORD document and invoking some attributes like line numbering,
etc.?
:
Only if it's a DOS version.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Is there a way to run WORD from DOS?
Jay Freedman said:Page numbering is a potential can of worms, especially if the document has
more than one section and if the footers have been unlinked ("Same as
Previous" turned off), or if the footer already contains text that shouldn't
be removed.
In any case, the InsertPageNumbers command is a problem for two reasons. One
is that it always displays that dialog, and the other is that it puts the
page number into a frame instead of putting it in the text of the footer --
that can cause problems later (see
http://word.mvps.org/faqs/formatting/unaccountablyindented.htm).
If you're planning to use these page numbers in new documents, it's much
better to create a custom template and place a Page field in the template's
footer. Then it will automatically appear in all new documents based on that
template.
For existing documents, you can use this macro. Possible problems: If
there's already any text in the footer, it will be removed. If there are
multiple sections and they're unlinked, the page numbers will appear only in
the first section. If the section is set to "Different first page" header
and footer, the page number will appear only on pages 2 and later; if it's
set to "Different even and odd", they won't appear on the even-numbered
pages. (You see what I mean by a can of worms... Most of these things could
be fixed, but the macro would grow considerably.)
Public Sub PageNumBottomCtr()
Dim MyRg As Range
Set MyRg = ActiveDocument.Sections(1) _
.Footers(wdHeaderFooterPrimary).Range
With MyRg
.Style = ActiveDocument.Styles("Footer")
.Text = vbTab
.Collapse wdCollapseEnd
.Fields.Add Range:=MyRg, Type:=wdFieldPage
End With
Set MyRg = Nothing
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP
Your solution worked perfectly, Jay. Thanks so much. I would like to
add one more thing. I would like to insert page numbers. I used the
InsertPageNumbers macro (e.g.: /mInsertPageNumbers). When I do that,
my document opens up (as expected) but then I get an additional
window (called Page Numbers) that asks me for the format for the page
numbering. That's expected I guess. My question now is... Could I use
the InsertPageNumbers macro (along with parameter values?) or create
another macro where the page numbering would default to parameter of
my coded choosing (i.e.: number pages at the bottom right)?
Jay Freedman said:There isn't any built-in command for line numbers, but you can put
this macro into Normal.dot (see
http://www.gmayor.com/installing_macro.htm):
Public Sub LineNums()
ActiveDocument.PageSetup.LineNumbering.Active = True
End Sub
Then use the command line
winword.exe "c:\docs\MyDocument.doc" /mLineNums
to number the document when it opens.
--
Regards,
Jay Freedman
Microsoft Word MVP
On Tue, 12 Jul 2005 16:26:03 -0700, Bee
Hey, Jay. I found what you said to be incredibly helpful. It suits
my purposes almost perfectly. I looked at the list of built-in WORD
commands and I couldn't find a macro (command) that inserts line
numbers. Suggestions?
:
Hi Bee,
Yes, depending on what command you want to run, that may be
possible.
For the specific example of a word count, you could run this
command line:
winword.exe "c:\docs\MyDocument.doc" /mToolsWordCount
The help (or, in expanded form,
http://support.microsoft.com/?kbid=210565) describes the last part
of that command as the "/mmacroname" switch, and it will indeed
work with macros stored in the Normal.dot template. For your
purposes, though, "macroname" also includes all the built-in Word
commands. To find the names that can be used in the switch, open
the Macros dialog (Alt+F8) and set the Macros In dropdown to "Word
commands".
I think you confused the issue a bit by referring to "the DOS
version". Some of us remember Word for DOS and thought that's what
you meant. Anyway, in current versions of Windows the command
processor isn't DOS, even though it responds to most of the same
syntax.
--
Regards,
Jay Freedman
Microsoft Word MVP
Bee wrote:
Basically, what I would like to do (if possible) is to use DOS to
open up WORD, load a WORD document, and invoke a simple WORD
command (i.e.: count the number of words in the document, etc.).
I guess a generic command at the DOS prompt would look something
like the following: winword.exe <name of document to be loaded>
[<command options>]
I hope I'm making better sense.
:
Are you asking whether it is possible to edit in a later version
of Word a document saved from a DOS version of Word?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Thanks. Is there a way to also load up a file a WORD document in
the DOS version? To take it a step further, how about load up a
WORD document and invoking some attributes like line numbering,
etc.?
:
Only if it's a DOS version.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Is there a way to run WORD from DOS?