Install a new printer on the system:
Http://www.devx.com/vb2themax/Tip/19284
Private type printer_info_2 pservername as string pprintername as string psharename as string pportname as string pdrivername as string pcomment as string plocation as string pdevmode as long enough pfile as string pprintprocessor as string pdatatype as string pparameters as bytes as long attributes as long priority as long defaultpriority as long starttime as long untiltime as long status as long cjobs as long averageppm as longend typeprivate declare function addprinter lib "winspool. DRV "alias" addprintera "_ (byval pname as string, byval level as long, pprinter as any) as longprivate declare function closeprinter lib" winspool. DRV "(byval hprinter AS _ long) as long 'Install a new printer on the system' sprintername is the name to assign to identify the printer 'sdriver is a string identifying the driver for the printer 'sport is the printer's com port 'scomment is a comment to associate to the printer item' 'example: 'dim Bok as Boolean 'Bok = installprinter ("Epson", "Epson stylus color 440", "LPT1:",' "my favorite printer") 'msgbox "Printer added: "& bokfunction installprinter (byval sprintername as string, byval sdriver as string, _ optional byval sport as string =" LPT1: ", optional sserver as string, _ optional scomment as string) as Boolean dim hprinter as long dim PI as printer_info_2 'fill the printer_info_2 struct with pi. pprintername = sprintername. pdrivername = sdriver. pportname = sport. pservername = sserver. pcomment = scomment. pprintprocessor = "winprint ". priority = 1. defaultpriority = 1. pdatatype = "Raw" end with 'add the printer hprinter = addprinter (sserver, 2, Pi) 'If successful close the printer and return true if hprinter <> 0 then closeprinter hprinter installprinter = true end ifend Function