用C#调用Word.printout打印时如何指定打印机 不指定

Else , 2009/05/05 14:37 , 代码片段,演示也有 , Comments(0) , Reads(2250) , Via Original
用thisApplication.ActivePrinter=printer;指定打印机  
    
  Word.Document   thisDocument   =   null;  
  Word.Application   thisApplication   =   null;//new   Word.ApplicationClass();  
  CreateWordDocument(faxfile,ref   thisDocument,ref   thisApplication);  
  string   printer=thisApplication.ActivePrinter;  
  thisApplication.ActivePrinter="I-FaxPrinter";  
  PrintOutDoc(thisDocument);  
  faxpath=@"c:\tempfax.tif";  
  object   saveChanges   =   Type.Missing;  
  object   originalFormat   =   Type.Missing;  
  object   routeDocument   =Type.Missing;  
  thisApplication.ActivePrinter=printer;  
  thisApplication.Quit(ref   saveChanges,   ref   originalFormat,   ref   routeDocument);
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]