if ascan(aa,"WIN2PDF")>0 set printer to NAME (aa[ascan(aa,"WIN2PDF")]) lcOutputFile=lcOutDir+; strtran(alltr(lcname)," ","_")+; "_"+territory + "_"+lcBOOKYYMM+".pdf" erase (lcOutputFile) * MODIFY REPORT maintdet repo form maintdet ; while tm_name=lctm_name and _name=lcname ; to file (lcOutputFile) noco endifBut with Office Automation, Excel, there is a problem (at least in versions prior to 2007, I do not have experience with 2007): in VBA there is no way to bypass the user dialog, and the only way to automate it is to "....Send keystrokes to the active application...." (as it is declared in VBA for Excel Help ). You may see the code example at www.foxite.com, Message ID: 13359. Also in associated
.ActivePrinter = "Win2PDF" **sets the WIndows Default Printer !? *.PrintOut(Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint) .PrintOut(.f.,.f.,"","C:\daily.pdf",,,,,,,.t.) .ActivePrinter = lcActivePrinter &&set default printer back