现在的文档很多都是用Word软件来编辑的,但如果你想在程序中把某些字符插入到Word文档中,那么下面的程序帮你忙:
procedure TForm1.Button1Click(Sender: Tobject);var MSWord: Variant;beginMSWord := CreateOLEObject(Word.Application);//连接WordMSWord.Documents.Open(FileName:=d:\test.doc, ReadOnly:=True);//打开外部Word文档MSWord.Visible := 1;//是否显示文件编辑MSWord.ActiveDocument.Range(Start:=0, End:=0);//开始改变的启止位置MSWord.ActiveDocument.Range.InsertAfter(Text:=Title);//在Word中增加字符TitleMSWord.ActiveDocument.Range.InsertParagraphAfter;MSWord.ActiveDocument.Range.Font.Name := Arial;//...[ 查看全文 ]