5、s("ExternalData").Visible=False'ply表示工作表标签Application.CommandBars("Ply").Enabled=FalseForEachcbarInCommandBars Debug.Printcbar.Name,cbar.NameLocal,cbar.VisibleNextEndSub Private Sub Test() Dim i As Long 8 Dim wordApp As New Word.Application Dim CBar As Office.CommandBar Dim CCt
6、l As Office.CommandBarControl Set CBar = wordApp.CommandBars(27) 'Bar Index For Each CCtl In CBar.Controls If CCtl.Id = 2041 Or CCtl.Id = 2604 Then '2041 Control ID CCtl.Enabled = False end if Next Set CBar = Nothing Set CCtl = N
7、othing Set wordApp = Nothing End Sub 这是屏蔽的方法,至于你要屏蔽的 Bar ID 是多少 Control ID 是多少看下面的 Word菜单一览表 CommandBar ID _ Control ID _ Control Caption Text11_2520_新建空白文档(&B) 1_23_打开(&O)... 1_3_保存(&S)