'* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2005-5-18 16:21:06
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'^The Code CopyIn [ThisDocument-ThisDocument]^'
'* -----------------------------
Option Explicit
'Sub FilePrintDefault()
' MsgBox "本文档不可打印!"
'End Sub
'Sub FilePrint()
' MsgBox "本文档不可打印!"
'End Sub
Sub Exapmle()
' On Error Resume Next
Application.CustomizationContext = ActiveDocument
With Application.CommandBars
If Me.Variables(1).Value <> 1 Then
.FindControl(ID:=2521).Enabled = False
.FindControl(ID:=4).Enabled = False
FindKey(KeyCode:=BuildKeyCode(wdKeyControl, wdKeyP)).Disable
Else
.FindControl(ID:=2521).Enabled = True
.FindControl(ID:=4).Enabled = True
FindKey(KeyCode:=BuildKeyCode(wdKeyControl, wdKeyP)).Rebind _
KeyCategory:=wdKeyCategoryCommand, Command:="FilePrint"
End If
End With
End Sub
'----------------------
Sub Sample()
Me.Variables.Add Name:="Test", Value:=1
End Sub
'----------------------
Sub Easy()
Me.Variables(1).Value = 1
End Sub
'----------------------
[此贴子已经被作者于2005-5-18 16:20:26编辑过] |