Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch Print *.rtf files with Word  (Read 15793 times)

0 Members and 1 Guest are viewing this topic.

ritzg

    Topic Starter


    Starter

    • Experience: Beginner
    • OS: Unknown
    Batch Print *.rtf files with Word
    « on: December 13, 2011, 08:36:33 AM »
    Hi,

    I have more than 100 rtf files in a folder on Windows 7.  I'd like to print them out from the command line.

    I have some code which will open a given rtf file in Word, print it and close it.  Unfortunately, printing the the rtf files that I have must alter the files, since Word brings up the Save dialogue box when I try to close the file.  So I have to manually close the file, obviously making it not as automatic as I'd like it.

    Here's the command:

    "C:\Program Files\Microsoft Office\Office12\winword.exe" test1.rtf /q /n /mFilePrintDefault /FileExit

    This works fine, exempt for the prompt to save or not save the file.  I'm looking for a command to discard all changes and close the file.

    Any help would be appreciated.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Batch Print *.rtf files with Word
    « Reply #1 on: December 13, 2011, 08:44:35 AM »
    Have you tried this method using Foxit which is a lightweight Free PDF app ? ?
    " Anyone who goes to a psychiatrist should have his head examined. "

    ritzg

      Topic Starter


      Starter

      • Experience: Beginner
      • OS: Unknown
      Re: Batch Print *.rtf files with Word
      « Reply #2 on: December 13, 2011, 09:37:41 AM »
      No, I haven't tried Foxit.

      Unfortunately, the place where I work locks down my computer, so I am not able to easily add new applications to it.  I should have mentioned that in my original post.

      soybean



        Genius
      • The first soybean ever to learn the computer.
      • Thanked: 469
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 10
      Re: Batch Print *.rtf files with Word
      « Reply #3 on: December 13, 2011, 09:45:29 AM »
      Since Foxit Reader is a PDF reader and since you said nothing about PDF in your original post, I don't see that Foxit has any relevance here. 

      Regarding Word, if you were normally opening a Word file and made a change and then, when exiting, did not want to save the change, you could simply Click No when Word asks whether you want to save the changes.  Can you do that via your command line? 

      ritzg

        Topic Starter


        Starter

        • Experience: Beginner
        • OS: Unknown
        Re: Batch Print *.rtf files with Word
        « Reply #4 on: December 13, 2011, 10:22:14 AM »
        Hi,

        I am definitely looking to print rtf files, not pdf files, at this time.

        If I understand your reply, you are suggesting that I "click no" from the command prompt.  Unfortunately, I don't know how to issue a "Click No" command from a command prompt.  Is this possible?


        soybean



          Genius
        • The first soybean ever to learn the computer.
        • Thanked: 469
        • Computer: Specs
        • Experience: Experienced
        • OS: Windows 10
        Re: Batch Print *.rtf files with Word
        « Reply #5 on: December 13, 2011, 11:06:48 AM »
        Quote
        I don't know how to issue a "Click No" command from a command prompt.  Is this possible?
        I don't know.  Hopefully, someone else will have an answer. 

        Salmon Trout

        • Guest
        Re: Batch Print *.rtf files with Word
        « Reply #6 on: December 13, 2011, 11:51:25 AM »
        I just did this with a file called document.rtf and Word opened the file, printed it, and quit without asking me if I wanted to save it.

        Code: [Select]
        "C:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE" Document.rtf /q /n /mFilePrintDefault /mFileExit
        Obviously I had to adapt the path to WINWORD.EXE for my system, so the question arises why does Word bring up (I presume) the Save As dialog?. This can happen from the Word Print button if the printer is not configured correctly, so I would check that out.


        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Batch Print *.rtf files with Word
        « Reply #7 on: December 13, 2011, 12:04:46 PM »
        Did you try with the /x switch?

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Batch Print *.rtf files with Word
        « Reply #8 on: December 13, 2011, 12:10:36 PM »
        I just did this with a file called document.rtf and Word opened the file, printed it, and quit without asking me if I wanted to save it.

        Code: [Select]
        "C:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE" Document.rtf /q /n /mFilePrintDefault /mFileExit
        Obviously I had to adapt the path to WINWORD.EXE for my system, so the question arises why does Word bring up (I presume) the Save As dialog?. This can happen from the Word Print button if the printer is not configured correctly, so I would check that out.
        That Worked for me as well. 

        Rob Pomeroy



          Prodigy

        • Systems Architect
        • Thanked: 124
          • Me
        • Experience: Expert
        • OS: Other
        Re: Batch Print *.rtf files with Word
        « Reply #9 on: December 13, 2011, 12:58:02 PM »
        Hoping the above works, but if not, an AutoIt script would do the trick (it could click on any buttons as needed).  http://www.autoitscript.com/site/autoit/
        Only able to visit the forums sporadically, sorry.

        Geek & Dummy - honest news, reviews and howtos

        patio

        • Moderator


        • Genius
        • Maud' Dib
        • Thanked: 1769
          • Yes
        • Experience: Beginner
        • OS: Windows 7
        Re: Batch Print *.rtf files with Word
        « Reply #10 on: December 13, 2011, 01:20:44 PM »
        Well color me embarrassed...i read rtf to be PDF...

        Sorry///my bad.
        " Anyone who goes to a psychiatrist should have his head examined. "

        Rob Pomeroy



          Prodigy

        • Systems Architect
        • Thanked: 124
          • Me
        • Experience: Expert
        • OS: Other
        Re: Batch Print *.rtf files with Word
        « Reply #11 on: December 14, 2011, 06:52:20 AM »
        You must be poonished.
        Only able to visit the forums sporadically, sorry.

        Geek & Dummy - honest news, reviews and howtos

        patio

        • Moderator


        • Genius
        • Maud' Dib
        • Thanked: 1769
          • Yes
        • Experience: Beginner
        • OS: Windows 7
        Re: Batch Print *.rtf files with Word
        « Reply #12 on: December 14, 2011, 07:16:24 AM »
         ;D

                              :o
        " Anyone who goes to a psychiatrist should have his head examined. "

        ritzg

          Topic Starter


          Starter

          • Experience: Beginner
          • OS: Unknown
          Re: Batch Print *.rtf files with Word
          « Reply #13 on: December 15, 2011, 07:53:11 AM »
          Hi,

          Thanks for all of the tips.

          I tried the /x switch.  It seemed to work the same way as before.  It brings up the same "Saves changes" dialogue box, just like before.

          I think my rtf file might have something different in it that is causing Word to modify it when I print it.  Checking out the print settings seems like a good idea.  Unfortunately, I'm such a newbie for things like this that I don't know what I'm looking for.

          I'll check out AutoIT.

          Glenn


          Raven19528



            Hopeful
          • Thanked: 30
            • Computer: Specs
            • Experience: Experienced
            • OS: Windows 7
            Re: Batch Print *.rtf files with Word
            « Reply #14 on: December 15, 2011, 04:45:37 PM »
            What version of Word are you using? There could be some unseen nuances between different Word versions that could be causing this issue.
            "All things that are
            Are with more spirit chased than enjoy'd" -Shakespeare