Z
ZengMuAnSha
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是用OleContainer来的 控制Excel 当根据要求来置打印开关。可是Word能控制
Excel就不能控制,编译运行都能通过 就是无效
v.Application.CommandBars['Standard'].Visible := true;
v.Application.CommandBars['Formatting'].Visible := True;
第二个问题 得到结果后如何结帖?
procedure Tpublic_showOle_Form.FormShow(Sender: TObject);
var
v: Variant;
begin
inherited;
if ReadOnly then
begin
WindowState := wsMaximized;
Ole.DoVerb(-1);
v := Ole.OleObject;
v.Application.CommandBars['Standard'].Visible := false;
v.Application.CommandBars['Formatting'].Visible := false;
Ole.DoVerb(-1);
mmSave.Visible := false;
CoolBar1.Visible := false;
end
else
begin
WindowState := wsMaximized;
Ole.DoVerb(-1);
v := Ole.OleObject;
v.Application.CommandBars['Standard'].Visible := true;
v.Application.CommandBars['Formatting'].Visible := True;
Ole.DoVerb(-1);
mmSave.Visible := True;
CoolBar1.Visible := True;
end;
Excel就不能控制,编译运行都能通过 就是无效
v.Application.CommandBars['Standard'].Visible := true;
v.Application.CommandBars['Formatting'].Visible := True;
第二个问题 得到结果后如何结帖?
procedure Tpublic_showOle_Form.FormShow(Sender: TObject);
var
v: Variant;
begin
inherited;
if ReadOnly then
begin
WindowState := wsMaximized;
Ole.DoVerb(-1);
v := Ole.OleObject;
v.Application.CommandBars['Standard'].Visible := false;
v.Application.CommandBars['Formatting'].Visible := false;
Ole.DoVerb(-1);
mmSave.Visible := false;
CoolBar1.Visible := false;
end
else
begin
WindowState := wsMaximized;
Ole.DoVerb(-1);
v := Ole.OleObject;
v.Application.CommandBars['Standard'].Visible := true;
v.Application.CommandBars['Formatting'].Visible := True;
Ole.DoVerb(-1);
mmSave.Visible := True;
CoolBar1.Visible := True;
end;