property FDocument : _Document Read GetDocument;
function TBaseWordFrm.GetDocument: _Document;
var
Doc: _Document;
begin
if WordOle.OleObjectInterface=nil then
Result := nil
else begin
WordOle.OleObjectInterface.QueryInterface(_Document,Doc);
Result := Doc;
end;
end;
function TBaseWordFrm.GetSelection: Selection;
begin
if Assigned(FDocument) then
Result := FDocument.Application.Selection;
end;
procedure SetFont(AFontName:string='仿宋_GB2312';AFontSize:Integer=16);
begin
if Assigned(FDocument) then
begin
GetSelection.Font.Name := AFontName;
GetSelection.Font.Size := AFontSize;
FDocument.Application.CommandBars.Item[2].Controls.Item[4].Execute;
end
end;在win2000中程序调用setfont时报错:“未指定的错误”
function TBaseWordFrm.GetDocument: _Document;
var
Doc: _Document;
begin
if WordOle.OleObjectInterface=nil then
Result := nil
else begin
WordOle.OleObjectInterface.QueryInterface(_Document,Doc);
Result := Doc;
end;
end;
function TBaseWordFrm.GetSelection: Selection;
begin
if Assigned(FDocument) then
Result := FDocument.Application.Selection;
end;
procedure SetFont(AFontName:string='仿宋_GB2312';AFontSize:Integer=16);
begin
if Assigned(FDocument) then
begin
GetSelection.Font.Name := AFontName;
GetSelection.Font.Size := AFontSize;
FDocument.Application.CommandBars.Item[2].Controls.Item[4].Execute;
end
end;在win2000中程序调用setfont时报错:“未指定的错误”
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货