uses ActiveX;var IOO: IOleInPlaceObject; begin OleContainer1.CreateObjectFromFile('C:\My.doc',False); OleContainer1.DoVerb(ovInPlaceActivate); if OleContainer1.State in [osUIActive] then begin OleContainer1.OleObjectInterface.QueryInterface(IOleInPlaceObject,IOO); IOO.UIDeactivate; //IOO.InPlaceDeactivate; IOO :=nil; end; end;
uses
ActiveX;var
IOO: IOleInPlaceObject;
begin OleContainer1.CreateObjectFromFile('C:\My.doc',False);
OleContainer1.DoVerb(ovInPlaceActivate);
if OleContainer1.State in [osUIActive] then
begin
OleContainer1.OleObjectInterface.QueryInterface(IOleInPlaceObject,IOO);
IOO.UIDeactivate;
//IOO.InPlaceDeactivate;
IOO :=nil;
end;
end;