请问如何在vb中使word的“保存按钮”、“另存为按钮”“保存图标”变为灰色不可用?
1个回答
展开全部
在Word中,添加一个按钮CommandButton1,单击按钮即可。
代码如下。
=============
Private Sub CommandButton1_Click()
Dim cmdSave1 As CommandBarControl, cmdSaveAs As CommandBarControl, cmdSave2 As CommandBarControl
Set cmdSave1 = CommandBars("file").FindControl(, 3)
cmdSave1.Enabled = False
Set cmdSaveAs = CommandBars("file").FindControl(, 748)
cmdSaveAs.Enabled = False
Set cmdSave2 = CommandBars("standard").FindControl(, 3)
cmdSave2.Enabled = False
End Sub
代码如下。
=============
Private Sub CommandButton1_Click()
Dim cmdSave1 As CommandBarControl, cmdSaveAs As CommandBarControl, cmdSave2 As CommandBarControl
Set cmdSave1 = CommandBars("file").FindControl(, 3)
cmdSave1.Enabled = False
Set cmdSaveAs = CommandBars("file").FindControl(, 748)
cmdSaveAs.Enabled = False
Set cmdSave2 = CommandBars("standard").FindControl(, 3)
cmdSave2.Enabled = False
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询