打印Word文档的例程

字体大小: 中小 标准 ->行高大小: 标准
uses ...ComObj...
var
WordApp : Variant;

begin
  WordApp:=CreateOLEObject('Word.Application'); 
  WordApp.Visible:=false; // it's the default, but in case you want to display
                          // it you just set the Visible to true 
  WordApp.PrintOut(FileName:="c:\config.sys", Range:=wdPrintAllDocument,
                   Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
                   PageType:=wdPrintAllPages, Collate:=True, Background:=True,
                   PrintTofile:=False);  //print out the file
  WordApp.Quit; 
  WordApp:=Unassigned;
end;

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68687.html