def publisher(pubfile, psfile, printer): pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) myPulisher = win32com.client.DispatchEx('Publisher.Application') myDoc = myPublisher.Open(pubfile,True,False,3); myDoc.ActivePrinter = printer myDoc.PrintOut(1,myDoc.Pages.Count,psfile,1,False) myDoc.Close() myPublisher.Quit() del myDoc del myPublisher pythoncom.CoUninitialize()