1 Reply Latest reply on Aug 31, 2016 11:44 PM by user19752

    XPS Location and File Name

    workgeek

      Now the Save to PDF option is not in available in Win7 runtime, but we can Print to XPS Printer.

       

      Question: How do we preset the Save Location and Save Name?

       

      I assume it might be a Send DDE Execute command, but how?

        • 1. Re: XPS Location and File Name
          user19752

          It looks there is no way to preset it.

          I automated it with vbscript.

           

          Globals::script is any global text field.

          "Save as..." should be window title in your language that xps printer shows for entering filename.

          C:\temp\\"&Get(UUID) should be replaced with your location and filename.

           

          Set Variable [$path; Value:Get(TemporaryPath) & Get(UUID) & ".vbs"]

          Set Field [Globals::script; Substitute ( "Set s=CreateObject(\"WScript.Shell\"):While s.AppActivate(\"TITLE\")=False:Wend:s.SendKeys(\"STR\")"; ["TITLE";"Save as..."]; ["STR";"C:\temp\\"&Get(UUID)&"{ENTER}"] )]

          Export Field Contents [Globals::script;“$path”;Automatically open]

          Print [Records being browsed;All Pages; Orientation:Portrait; Paper size:8.26" x 11.69" ]

                [Restore: Microsoft XPS Document Writer; No dialog]