E
eprun
Unregistered / Unconfirmed
GUEST, unregistred user!
我用delphi做了一个将word 2000文档输出为html的程序,但是运行时,老是有个对
话框弹出,提示放入office 2000的cd,但输出结果是正确的。不知那里没有控制好,
源码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,comobj, Word_TLB;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var wrd,Dc:variant;
begin
wrd:=createoleobject('word.Application');
wrd.visible:=false;
try
Dc := Wrd.Documents.open('d:/1/111.doc');
wrd.ActiveDocument.SaveAs('d:/1/111.htm',wdFormatHTML);
finally
Dc.Close(false) ;
Wrd.Quit(False) ;
end;
end;
end.
话框弹出,提示放入office 2000的cd,但输出结果是正确的。不知那里没有控制好,
源码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,comobj, Word_TLB;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var wrd,Dc:variant;
begin
wrd:=createoleobject('word.Application');
wrd.visible:=false;
try
Dc := Wrd.Documents.open('d:/1/111.doc');
wrd.ActiveDocument.SaveAs('d:/1/111.htm',wdFormatHTML);
finally
Dc.Close(false) ;
Wrd.Quit(False) ;
end;
end;
end.