How to get the list of all printers in computer

is possible with clarion?

EnumPrinters api, or WMI query “SELECT * from Win32_Printer”.

how i can use this with clarion? any example?

WMI example, required Active scripting:

EnumPrinters                  PROCEDURE()
wmi                             TVBWMI
i                               LONG, AUTO
  CODE
  FREE(PrintersQ)
  
  wmi.Init(site)
  wmi.Connect()
  wmi.ExecQuery(`Select * from Win32_Printer`)
  
  LOOP i=1 TO wmi.items.Count()
    CLEAR(PrintersQ)
    PrintersQ:Name = wmi.items.GetProp(i, 'Name')
    ADD(PrintersQ)
  END
1 Like

Ice Tips has EnumPrinters in Articles with an example. The example does not follow Lee’s suggestion to call once to get the required size.

Also an example on below page described as "Using enumprinters api - Example - Olivier Cretey GetPrinterJobStatus.zip " (attached eblow)

GetPrinterJobStatus.zip (4.8 KB)

Thanks Carl Barnes…