M
MPMM
I have been using Automation to manage access to some of the menubar items in
Office XP.
For example I use the following code to disable all the instances of the
copy command:
//coontrol ID 19 = copy
copyCmds =
oDoc.ActiveWindow.Document.CommandBars.FindControls(MsoControlType.msoControlButton, 19, null, null);
foreach (CommandBarControl copyCmd in copyCmds)
{
copyCmd.Enabled = false;
}
This works perfectly in Office XP but when I try to run this in Word 2007
the Copy command in the ribbon does not get disabled (other copy command such
as the pop up edit menu are disabled as expected).
Is it possible to disable specific menubar items in 2007 in this way?
Is it possible at all in 2007?
TIA
Craig
Office XP.
For example I use the following code to disable all the instances of the
copy command:
//coontrol ID 19 = copy
copyCmds =
oDoc.ActiveWindow.Document.CommandBars.FindControls(MsoControlType.msoControlButton, 19, null, null);
foreach (CommandBarControl copyCmd in copyCmds)
{
copyCmd.Enabled = false;
}
This works perfectly in Office XP but when I try to run this in Word 2007
the Copy command in the ribbon does not get disabled (other copy command such
as the pop up edit menu are disabled as expected).
Is it possible to disable specific menubar items in 2007 in this way?
Is it possible at all in 2007?
TIA
Craig