Board index » delphi » Delphi 5 - Word/Excel.. disable buttons/menus

Delphi 5 - Word/Excel.. disable buttons/menus

Hi to all.

I need to disable some button and menus (Save/SaveAs) from Word and/or
Excel.
Any hint?

I'm using Delphi 5.

Thank you in advance.

by(e) Doriano
e-mail: doria~n~o@skyli~n~k.it
To reply, delete ~

 

Re:Delphi 5 - Word/Excel.. disable buttons/menus


<<Doriano Biondelli:
I need to disable some button and menus (Save/SaveAs) from
Word and/or Excel.

Quote

It's pretty much the same procedure in both apps. Here's a
Word example:

var
  Btn, OleTrue: OleVariant;
begin
  Btn := Word.CommandBars['Standard'].Controls['Print'];
  Btn.Visible := False;
  Btn.Enabled := False;

You can also delete buttons and menuitems, like this:  
  OleTrue := True;
  Word.CommandBars['Standard'].Controls['Print'].
    Delete(OleTrue);
  Word.CommandBars['File'].Controls['Print...'].
    Delete(OleTrue);

--
Deborah Pate

Other Threads