Answered xps document writer

  • Sunday, March 11, 2012 2:13 PM
     
     

    I have a small program in which I am printing to XPS Document Writer.  I want to set the output file name from within my program.  I don't want the user to have to enter a file name.    How can I set the name of the *.xps file in my program?

    Thanks, Philip

     

All Replies

  • Sunday, March 11, 2012 2:19 PM
     
     Answered Has Code
    I figured it out.  Set the output to file and then set the file name.  Like this
     PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = True
            PrintForm1.PrinterSettings.PrinterName = "Microsoft XPS Document Writer"
            PrintForm1.PrinterSettings.PrintToFile = True
            PrintForm1.PrinterSettings.PrintFileName = "C:\Philip.XPS"
    
            PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)

    Thanks.
    • Marked As Answer by Philip Potts Sunday, March 11, 2012 2:19 PM
    •  
  • Tuesday, March 13, 2012 7:22 AM
    Moderator
     
     

    Hi Rothy909,

    Welcome to the MSDN forum.

    I’m glad to hear you find the solution to your issue by yourself.  Thanks for sharing the solution here, and it will help other members who has similar issue. 

    Have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us


  • Wednesday, March 14, 2012 5:33 PM
     
     
    Thank you Mark for the kind reply.  I was happy to respond with the solution to my own question in hope that it may be of benefit to others. 

    Philip


    • Edited by Philip Potts Saturday, March 17, 2012 2:02 PM word correction
    •