当前位置:首页>开发>正文

Delphi的经典例子有什么 谁有用Delphi控制Word的例子

2023-07-16 03:23:00 互联网 未知 开发

 Delphi的经典例子有什么 谁有用Delphi控制Word的例子

Delphi的经典例子有什么?

1Delphi XE在C:Documents and SettingsAll UsersDocumentsRAD Studio8.0Samples目次下!Delphi7在Delphi7Demos目次下

谁有用Delphi控制Word的例子

把memo中的纪录导入到word档的例子,你可以参考一下: 
单元接口引用 comobj单元。 
procedure TForm1.Button3Click(Sender: TObject) 
var Word : Variant 
begin 
try 
Word := CreateOLEObject(Word.Application); 
Word.Documents.Open(extractfilepath(Application.ExeName) est.doc,false) 
Word.Visible := false 
Word.ActiveDocument.Range(0, 0) 
Word.ActiveDocument.Range.InsertAfter(memo1.Lines.Text) 
Word.ActiveDocument.Range.InsertParagraphAfter 
Word.ActiveDocument.Range.Font.Name := MS Sans Serif
Word.ActiveDocument.Range.Font.Size := 24
Word.Quit 
finally 
Word.Quit 
end

最新文章