1 Reply Latest reply on Dec 3, 2008 10:12 AM by (Robert_Tkaczyk)

    CS3 Print Routine (VBScript)

      I'm trying to write a fairly simple print routine that will ask a user for a folder and then print every ID file in that folder to a PDF using a printer preset. Here's what I have so far:

      Set myInDesign = CreateObject("InDesign.Application.CS3")
      sDirName = InputBox("Folder to convert?")

      Set fso = CreateObject("Scripting.FileSystemObject")
      Set fldr = fso.GetFolder(sDirName)
      Set fls = fldr.Files

      For each aFile in fls
      strFileName = CStr(aFile)
      Set myDoc = myInDesign.Open(strFileName)
      myInDesign.ActiveDocument.PrinterPreset = "small"

      myInDesign.ActiveDocument.PrintOut False
      myInDesign.ActiveDocument.Close
      Set myDoc = Nothing
      Next

      Set myInDesign = Nothing
      Set fso = Nothing

      I'm getting this error on the PrinterPreset line:
      #438 - Object doesn't support this property or method

      I'm sure I found this somewhere in my searching, but I guess it's wrong. Does anyone know what the actual syntax is?

      Thanks!
        • 1. Re: CS3 Print Routine (VBScript)
          Level 1
          Document - and myInDesign.ActiveDocument - don't have PrinterPreset property

          from VB6 ObjectBrowser:

          Sub PrintOut([PrintDialog], [Using])
          Member of InDesign.Document
          Prints the Document(s). / PrintDialog: Whether to invoke the print dialog as Boolean / Using: Printer preset to use as idPrinterPresetTypes enumerator or PrinterPreset

          so, you need to delete this line and in next line add second parameter - printer preset you want to use

          call myInDesign.ActiveDocument.PrintOut(False, myInDesign.PrinterPresets.Item("small")

          robin

          --
          www.adobescripts.com