PRB: SET DEVICE TO PRINTER PROMPT Does Not Open Dialog Box

Last reviewed: April 29, 1996
Article ID: Q98746
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6x

SYMPTOMS

Issuing the SET PRINTER ON PROMPT or SET DEVICE TO PRINTER PROMPT command immediately after issuing the same command does not produce the expected Microsoft Windows Print dialog box.

CAUSE

Once the printer has been defined, FoxPro does not display the Print dialog box again until the printer is once again in an undefined state. For example, this problem will occur if the previous print job has not yet been released by Print Manager or the network spooler.

RESOLUTION

To work around this problem, do one of the following:

  • Add the command SET PRINTER TO to the end of your program so the print job will be released each time the program is run and consequently, the Print dialog box will appear every time.

    -or-

  • Use the following code sequence after the print job is completed:

       SET PRINTER OFF        && disables output to the printer.
       SET PRINTER TO         && resets output to default MS-DOS PRN print
                              && utility
    
       NOTE: The SET PRINTER TO command causes a page to be ejected from
       the printer. A workaround to this behavior is not known at this
       time.
    
    

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To reproduce the problem, run the following program twice:

   SET DEVICE TO PRINTER PROMPT
   @ 3,3 SAY 'HELLO,WORLD'
   SET DEVICE TO SCREEN

The first time the program is run, the Print dialog box will appear as expected. The second time the program is run, the dialog box will not appear although both print jobs are in the print queue.

NOTE: Both jobs will print if you quit FoxPro for Windows or if you issue the SET PRINTER TO command in the Command window. Also, if the Cancel button on the prompt is selected, FoxPro ignores this action and sends the @...SAY commands to the printer anyway.

REFERENCES

"Language Reference," version 2.5, page L3-973


Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a 2.50b 2.60 2.60a
no output device to print prompt
KBCategory: kbprg kbprb
KBSubcategory: FxprintNet


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.