J
jerry051
just like title, how to enable/disable menu item of word addin when word is
running? button's enable/disable is work well ,but menu item's
enable/disable isnot work. my code as:
CommandBarButton btnLogout =
(CommandBarButton)wdApp.CommandBars.FindControl(oMissing,oMissing,"btnMyLogo
ut" + ,oMissing);
CommandBarButton mnLogout =
(CommandBarButton)wdApp.CommandBars.FindControl(oMissing,oMissing,"menuMyLog
out" + ,oMissing);
if (isLogin)
{
btnLogout.Enabled = true; //work well;
mnLogout.Enabled = true; //not work;
}
else
{
btnLogout.Enabled = false; //work well;
mnLogout.Enabled = false; //not well;
}
when addin is loading,menuItem's Enabled property could be set true or
false, then it work well. but once it has been loaded complete, then set
menuItem's enabled property is not work. how to resolve this? thanks a lot.
running? button's enable/disable is work well ,but menu item's
enable/disable isnot work. my code as:
CommandBarButton btnLogout =
(CommandBarButton)wdApp.CommandBars.FindControl(oMissing,oMissing,"btnMyLogo
ut" + ,oMissing);
CommandBarButton mnLogout =
(CommandBarButton)wdApp.CommandBars.FindControl(oMissing,oMissing,"menuMyLog
out" + ,oMissing);
if (isLogin)
{
btnLogout.Enabled = true; //work well;
mnLogout.Enabled = true; //not work;
}
else
{
btnLogout.Enabled = false; //work well;
mnLogout.Enabled = false; //not well;
}
when addin is loading,menuItem's Enabled property could be set true or
false, then it work well. but once it has been loaded complete, then set
menuItem's enabled property is not work. how to resolve this? thanks a lot.