procedure TForm1.WebBrowser1DocumentComplete(ASender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
var
cbStandard: OleVariant;
begin
cbStandard := 1;
with (WebBrowser1.Document AS _Document) do
begin
ActiveWindow.View.ShowAll := False;
ActiveWindow.View.TableGridlines := True;
ActiveWindow.DisplayRulers := False;
WordApplication1.ConnectTo(ActiveWindow.Application);
end;
//Make sure the 'Standard' toolbar is targeted.
ShowMessage(WordApplication1.CommandBars.Item[cbStandard].Name);
//ShowMessage returns 'Standard' successfully.
//Why doesn't this next line work???
WordApplication1.CommandBars.Item[cbStandard].Set_Visible(True);
end;
Thanks,
SB