|
* Please run the first macro firstly, so you can work well! Enjoy!
- Sub HotkeyFirstLineIndent()
- KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyF3), KeyCategory:= _
- wdKeyCategoryCommand, Command:="DecreaseLeftIndent"
- KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyF4), KeyCategory:= _
- wdKeyCategoryCommand, Command:="IncreaseLeftIndent"
- MsgBox "F3: DecreaseLeftIndent" & vbCr & "F4: IncreaseLeftIndent", 0 + 48
- End Sub
- Sub IncreaseLeftIndent()
- With Selection
- If .Information(wdWithInTable) = False Then MsgBox "Please put cursor in the table!", 0 + 16: End
- If .Type = wdSelectionIP Then MsgBox "Not-Select!", 0 + 16: End
- With .ParagraphFormat
- If .CharacterUnitLeftIndent = -0.5 And .LeftIndent = -5.25 Then
- .CharacterUnitLeftIndent = 0
- .LeftIndent = CentimetersToPoints(0)
- Else
- .CharacterUnitLeftIndent = .CharacterUnitLeftIndent + 0.5
- End If
- End With
- End With
- End Sub
- Sub DecreaseLeftIndent()
- With Selection
- If .Information(wdWithInTable) = False Then MsgBox "Please put cursor in the table!", 0 + 16: End
- If .Type = wdSelectionIP Then MsgBox "Not-Select!", 0 + 16: End
- With .ParagraphFormat
- If .CharacterUnitLeftIndent = 0.5 And .LeftIndent = 5.25 Then
- .CharacterUnitLeftIndent = 0
- .LeftIndent = CentimetersToPoints(0)
- Else
- .CharacterUnitLeftIndent = .CharacterUnitLeftIndent - 0.5
- End If
- End With
- End With
- End Sub
复制代码 |
|