P
PLA-APIN
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
current_tables:Tables;
template,newtemplate:OleVariant;
//year,month,day:word;
//sjstr:string;
begin
try
WordApplication1.Connect ;
except
MessageDlg('Word may not be installed',mtError,[mbok],0);
Abort;
end;
template:=ExtractFileDir(Application.ExeName)+'/modal/打印封面';
newtemplate:=False;
WordApplication1.Connect;
WordApplication1.Visible:=False;
WordApplication1.Caption:='打印封面';
WordApplication1.Documents.Add(template,newtemplate);
current_tables:=WordApplication1.ActiveDocument.Get_Tables;
wordapplication1.Visible:=true;
end;
这段程序在DELPHI5.0可以通过,但在DELPHI6.0过不去。
显示这行WordApplication1.Documents.Add(template,newtemplate);有错。哪位大虾帮忙?
var
current_tables:Tables;
template,newtemplate:OleVariant;
//year,month,day:word;
//sjstr:string;
begin
try
WordApplication1.Connect ;
except
MessageDlg('Word may not be installed',mtError,[mbok],0);
Abort;
end;
template:=ExtractFileDir(Application.ExeName)+'/modal/打印封面';
newtemplate:=False;
WordApplication1.Connect;
WordApplication1.Visible:=False;
WordApplication1.Caption:='打印封面';
WordApplication1.Documents.Add(template,newtemplate);
current_tables:=WordApplication1.ActiveDocument.Get_Tables;
wordapplication1.Visible:=true;
end;
这段程序在DELPHI5.0可以通过,但在DELPHI6.0过不去。
显示这行WordApplication1.Documents.Add(template,newtemplate);有错。哪位大虾帮忙?