H
hathaway
Unregistered / Unconfirmed
GUEST, unregistred user!
大家好! 想请教大家一个问题,就是怎样在delphi中打开word文档,并在word文档中输入文档,文档包括数据库中的数据,这些具体怎样实现?我试过通过以下代码:
procedure TForm1.Button2Click(Sender: TObject);
begin
wordapplication1.Connect;
wordapplication1.Visible:=true;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
t1,newt1,t1index,type1,v1levariant;
begin
t1:=emptyparam;
newt1:=emptyparam;
type1:=combobox1.ItemIndex;
v1:=true;
t1index:=1;
fstart:=0;
fend:=0;
wordapplication1.Documents.Add(t1,newt1,type1,v1);
worddocument1.Connectto(wordapplication1.Documents.Item(t1index));
end;
运行了,点击任何一个button就没有反映?是不是连接word有问题吗?
procedure TForm1.Button2Click(Sender: TObject);
begin
wordapplication1.Connect;
wordapplication1.Visible:=true;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
t1,newt1,t1index,type1,v1levariant;
begin
t1:=emptyparam;
newt1:=emptyparam;
type1:=combobox1.ItemIndex;
v1:=true;
t1index:=1;
fstart:=0;
fend:=0;
wordapplication1.Documents.Add(t1,newt1,type1,v1);
worddocument1.Connectto(wordapplication1.Documents.Item(t1index));
end;
运行了,点击任何一个button就没有反映?是不是连接word有问题吗?