delphi如何控制word。
1个回答
2012-01-11
展开全部
procedure TForm1.btn1Click(Sender: TObject);
var FileName : OleVariant;
begin
with TWordDocument.Create(Self) do
try
Connect;
Content.Text := 'Hello world!';
FileName := 'd:\kk\AA.doc';
SaveAs(FileName);
finally
Disconnect;
Free;
end;
end;
var FileName : OleVariant;
begin
with TWordDocument.Create(Self) do
try
Connect;
Content.Text := 'Hello world!';
FileName := 'd:\kk\AA.doc';
SaveAs(FileName);
finally
Disconnect;
Free;
end;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询