如何在一个线程中通过OLE的方式来调用WORD97(100分)

X

xyw

Unregistered / Unconfirmed
GUEST, unregistred user!
如何在一个线程中通过OLE的方式来调用WORD97?
procedure TPrinterThread.Execute(Sender : TObject);

var
Word: Variant;



begin


Word := CreateOleObject('Word.Basic');

---->ERROR:未调用coInitialize
Word.FileNew('Normal');

Word.Insert('This is the first line'#13);

Word.Insert('This is the second line'#13);

Word.FileSaveAs('c:/temp/test.txt', 3);

end;


谢谢大家了!
 
uses ole2;//ole2在lib/delphi2目录下
try
coIniitialize;
word:=...
except
end;
 
给你发了一个。
 
为什么新建一个Word.Basic而不用Word.Application?
 
接受答案了.
 

Similar threads

I
回复
0
查看
577
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部