3 Replies Latest reply on Apr 28, 2008 5:04 AM by TNT Type

    Printer Presets CS3, VB

      I've written a script that allows our operators to print the page they are on to a file and it works fine. I now want to add the use of a preset but can't figure out how the command works.

      Currently I have the below code with IDoc set to the ActiveDocument.
      IDoc.PrintPreferences.PageRange = IPage.Name
      IDoc.PrintPreferences.PrintFile = PrintName$
      IDoc.PrintOut False

      The first parameter of the PrintOut command ("False" as shown above) causes the print dialog to appear or not appear. Everything I read a second optional parameter is for the print preset to be used. I've tried InD.PrinterPresets(1) but it isn't working. I currently have three presets, If I use a zero in the parens I'm getting a dialog to type the filename, which I don't need or want. A 2 or a 3 doesn't make any file at all, any thing else I get member doesn't exist in this collection, which I would expect.

      What am I missing?

      Many thanks.
        • 1. Re: Printer Presets CS3, VB
          Level 1
          Hi Ken,

          I don't know the VB but the JS is:

          var myPDFExportPreset = app.pdfExportPresets.item("Preset");

          I hope this helps you figure out the VB.

          • 2. Re: Printer Presets CS3, VB
            Level 1
            Thanks Brett, your confirmation made me dig a bit further. The earlier attempts I made were actually working, however, when using the preset InD apparently ignores the .PrintPreferences.PrintFile= command and uses the print file from the preset, or at least the last filename used before the preset was saved.

            Now I'll look to see if there is a way to set the output filename in the preset.

            Thanks again,
            • 3. Re: Printer Presets CS3, VB
              Level 1
              That was pretty simple. It doesn't matter whether you assign a reference or simply use the item within the presets (InD.PrinterPresets(2), for instance), the part I was missing is that when a preset is used in the .Printout command the .PrintPreferences.Printfile setting is ignored.

              You can set the filename for the preset simply by using .PrintFile on the preset and it works wonderfully.

              i.e.: MyPrintPreset.PrintFile=MyFilename$ or .PrintPresets(2).PrintFile="MyFilename$