Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing Word documents from a command-line (Word 2000)

    I'm trying to work out a way to print out Word documents from a batch file (in order to automate printing of documents in what is currently a very slow manual process of detaching the files from email and printing them).

    Going through the winword.exe command line options has no "/p" like most other programs. Crawling through REGEDIT suggests that you need to use "/x" and then pass a DDE command to Word to tell it to print. I have no idea how to do this from a batch file.

    Does anyone have any ideas on how to do this, or know of a cheap program that can do this?
    Could an AUTOEXEC macro be used for this?

    Thanks in advance

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing Word documents from a command-line (Word 2000)

    You don't need AutoExec.

    Just write a macro to do the deed and in your batch file, invoke Word using the /m switch.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Printing Word documents from a command-line (Word 2000)

    Depending on how much time you have to play with VBA, you can automate as little or as much of this as you like.

    <UL><LI>Manual process = Open message, save attachments to disk, open file, print, close file, next...

    <LI>Fully automated process = Open message, click button, macro opens each document and prints and closes it.

    <LI>Partially automated process = Open message, save attachments to disk, run "batch file" or Word macro.[/list]I put batch file in quotes because you have an additional scripting tool at your disposal: VBScript. For an example of one way to automate the printing of multiple files (all files in a specified directory) see <!post=Post #139029,139029>Post #139029<!/post>.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •