WORD自定義宏


自定義快捷鍵

折疊所有標題

Word選項—自定義功能區—自定義鍵盤—不在功能區內的命令—ColllapseAllHeadings

 

展開所有標題

Word選項—自定義功能區—自定義鍵盤—不在功能區內的命令—ExpandAllHeadings

 

全屏快捷鍵 Alt+V+U, esc退出 可通過錄制宏設定F11全屏

 

Word自定義宏

 

Sub 標題1()
    Selection.Style = ActiveDocument.Styles("標題 1")
End Sub

Sub 標題2()
    Selection.Style = ActiveDocument.Styles("標題 2")
End Sub

Sub 藍色文字()
    Selection.Font.Color = wdColorBlue
End Sub

Sub 刪除整段()
    Selection.MoveDown Unit:=wdParagraph, Count:=1
    Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
    Selection.TypeBackspace
End Sub

Sub 顯示導航目錄()
    If ActiveWindow.DocumentMap = True Then
        ActiveWindow.DocumentMap = False
    Else
        ActiveWindow.DocumentMap = True
    End If
End Sub

Sub 紅色文字()
    Selection.Font.Color = wdColorRed
End Sub

Sub 換行()
    Selection.EndKey Unit:=wdLine
    Selection.TypeParagraph
End Sub

Sub 全屏顯示()
    ActiveWindow.View.FullScreen = Not ActiveWindow.View.FullScreen
End Sub

Sub 標題3()
    Selection.Style = ActiveDocument.Styles("標題 3")
End Sub

Sub 淺色文字()
    Selection.Font.Color = wdColorGray25
End Sub

Sub 黑色文字()
    Selection.Font.Color = wdColorBlack
End Sub

Sub 行前插入空行()
    Selection.HomeKey Unit:=wdLine
    Selection.TypeParagraph
    Selection.MoveUp Unit:=wdLine, Count:=1
End Sub

Sub 回到前一位置()
    Application.GoBack
End Sub

Sub 復制當前行()
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Copy
    Selection.PasteAndFormat (wdFormatOriginalFormatting)
    Selection.PasteAndFormat (wdFormatOriginalFormatting)
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
End Sub

Sub 增強復制()
    If Selection.Type = wdSelectionIP Or Selection.Type = wdNoSelection Then  '若選擇為空
        Selection.HomeKey Unit:=wdLine
        Selection.EndKey Unit:=wdLine, Extend:=wdExtend
        Selection.Copy
        '復制整行  'MsgBox "沒有選擇"
    Else  '若選擇不為為空
        '正常操作
        Selection.Copy
    End If
End Sub

Sub 增強剪切()
    If Selection.Type = wdSelectionIP Or Selection.Type = wdNoSelection Then  '若選擇為空
        Selection.HomeKey Unit:=wdLine
        Selection.EndKey Unit:=wdLine, Extend:=wdExtend
        Selection.Cut
        '剪切整行  'MsgBox "沒有選擇"
    Else  '若選擇不為為空
        '正常操作
        Selection.Cut
    End If
End Sub
Sub 單頁170()
    With ActiveWindow.ActivePane.View.Zoom
        .PageColumns = 1
        .PageRows = 1
    End With
    ActiveWindow.ActivePane.View.Zoom.Percentage = 170
End Sub
Sub 雙頁92()

    With ActiveWindow.ActivePane.View.Zoom
        .PageColumns = 2
        .PageRows = 1
    End With
    ActiveWindow.ActivePane.View.Zoom.Percentage = 92
    With ActiveWindow.View.RevisionsFilter
        .Markup = wdRevisionsMarkupNone
        .View = wdRevisionsViewFinal
    End With
End Sub

 

楊韜的學習備忘錄  YTYT2002YTYT

http://www.cnblogs.com/ytyt2002ytyt/p/4008371.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM