Consulting

Results 1 to 6 of 6

Thread: Batch Print .doc to .prn VBA

  1. #1

    Batch Print .doc to .prn VBA

    I routinely need to print .doc files to .prn (which I then rename as .txt files) and I'm looking for a way to batch print.

    For the types of files I work on, it's necessary to print to .prn and rename as .txt as printing to .txt or saving directly to .txt messes up my formatting.

    Does anyone have a VBA suggestion?

    Thank you!

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    528
    Location
    I am not familiar with "printing" a DOC file to PRN. Is that the same as saving a DOC file to the PRN format ?

    Also ... does the following resource help in part, with the process ?
    https://www.dell.com/support/kbdoc/e...r-applications

  3. #3
    Quote Originally Posted by Logit View Post
    I am not familiar with "printing" a DOC file to PRN. Is that the same as saving a DOC file to the PRN format ?

    Also ... does the following resource help in part, with the process ?
    https://www.dell.com/support/kbdoc/e...r-applications

    Printing to .prn is different than saving a .doc to .prn. When you print to .prn you use the generic/text printer which strips some formatting from the .doc, but leaves others. Your result will be different also from saving to .txt.

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,311
    Location
    For a single document, that's as simple as:
    Sub Demo()
    With ActiveDocument
      .PrintOut PrintToFile:=True, OutputFileName:=Split(.FullName, ".doc")(0) & ".txt"
    End With
    End Sub
    You need to clarify, though, how the members of a batch print would be identified (e.g. all open documents, all documents in a selected/specified folder, documents selected from a pick list, other).
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    https://www.gmayor.com/Batch_Print.htm will allow you to select the generic/text printer and 'print' to a folder of your choice.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  6. #6
    Thank you!

Posting Permissions

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