Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Word PrintToFile Revisited (Word 2003)

    It's been a couple of years since there was any discussion on how to turn off PrintToFile without actually having to print anything. I've got an application that I enable the PrintToFile option to create a file for spooling to a network printer. I've been clearing the PrintToFile by setting it false and printing a zero page document back to the default printer. Unfortunately, while nothing prints, it results in a banner page printing, which our systems folks need to be on. Anybody found a way to toggle this off?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word PrintToFile Revisited (Word 2003)

    I think the only way to avoid the banner page would be to define a printer that is set to print to file (set the printer port to be used to FILE, switch to this printer before printing to file, then switch back to the original printer.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Re: Word PrintToFile Revisited (Word 2003)

    Hi Hans,

    That's not exactly the problem. The user's network printer is one that everyone in the department uses. Thus the need for a banner page. The 'PrintToFile' method is fine for generating a disk file. However, when the PrintToFile option is set true to print to a file, it remains set even when the user quits, then restarts Word. So, the next time they print anything, their document gets printed to a file. Which is why I have to do a PrintOut with the 'PrintToFile' toggled to false, then issue it with a 'Pages=0' paramter included to their original default printer. That setting won't change unless a print command is actually issued, resulting in a banner page with no pages following.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word PrintToFile Revisited (Word 2003)

    I have an Epson inkjet printer, and I have defined two printers using its printer driver in the Printers control panel: "Epson" prints to LPT1: and "EpsonPrint" prints to FILE:

    The following code creates a print file, then resets the printer.

    Dim strPrinter As String
    ' Store current printer
    strPrinter = Application.ActivePrinter
    ' Set printer to one that prints to file
    Application.ActivePrinter = "EpsonFile"
    ' Print the document - we don't specify PrintToFile:=True
    ' But we still create a file specified by SendKeys
    SendKeys "NameOfFile.prn{ENTER}"
    ActiveDocument.PrintOut
    ' Restore the original printer
    Application.ActivePrinter = strPrinter

    After running this code, the 'Print to file' check box in the Print dialog is NOT checked.

  5. #5
    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: Word PrintToFile Revisited (Word 2003)

    For cross-reference, the earlier thread is: Print to File turn off (OfficeXP SP3).

    Is there a {PRINT} code you could insert into your throwaway document that would suppress the banner?

    Can the software managing the queue get a clue and not print a banner for an empty print job?

    Can you set up a "queue to nowhere" on the server and print the throwaway job to that "printer" before restoring the usual ActivePrinter?

    (Added: I see I posted my best thinking, such as it was, in this other thread: <post:=476,654>post 476,654</post:>)

  6. #6
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Re: Word PrintToFile Revisited (Word 2003)

    I'll have to play around since I went down a different path for creating the print job and, later, spooling the print file to the networked printer:

    'Set active printer to Adobe Postscript printer
    Application.ActivePrinter = strDocumentPrinter

    'Set the current Adobe PostScript printfile and location
    strTemp = "C:TempWPrint" + strTempPrint + ".prn"

    'Create the printfile
    ActiveDocument.PrintOut Background:=False, Range:=wdPrintAllDocument, OutputFileName:=strTemp, Item:= _
    wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
    Collate:=True, PrintToFile:=True

    'Spool to networked IBM mainframe printer
    ........

    'Restore the default ptinter
    Application.ActivePrinter = strActivePrinter

    'Turn off PrintToFile
    ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Pages:="0", PrintToFile:=False

    The networked printer que isn't configurable to turn on/turn off banner pages from the user end. It's a network administrator item only.

    I'll have to ask if a 'dummy' que could be set up for this issue.

    Thanks.

Posting Permissions

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