|
底下也是我未學VBA時,錄製拼湊修改的代碼,有些冗長,需要的可自行優化代碼,並分享給大家。
這是針對選擇字元加圓圈的代碼,字元有分個數,程序不同,要自行選擇適當的程序。
Sub 圓圈外加單數字()
'
' 圓圈外加單數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 5 / 6
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加雙數字()
'
' 圓圈外加雙數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 2 / 3
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加雙1數字()
'
' 圓圈外加雙1數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 2 / 3
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加3數字()
'
' 圓圈外加3數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加31數字()
'
' 圓圈外加31數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加4數字()
'
' 圓圈外加4數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
Selection.Font.Scaling = 70
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加41數字()
'
' 圓圈外加41數字 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
Selection.Font.Scaling = 70
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加單中文()
'
' 圓圈外加單中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 7 / 12
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加單3中文()
'
' 圓圈外加單3中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加雙中文()
'
' 圓圈外加雙中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
Selection.Font.Scaling = 70
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加雙1中文()
'
' 圓圈外加雙1中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 1 / 2
Selection.Font.Scaling = 70
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加3中文()
'
' 圓圈外加3中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 4 / 9
Selection.Font.Scaling = 50
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Sub 圓圈外加3長中文()
'
' 圓圈外加3中文 巨集
' 巨集錄製於 2007/10/2,錄製者 Pan
'
Selection.Cut
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"EQ \O\AC(,)", PreserveFormatting:=False
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveWindow
With .View
.ShowFieldCodes = False
End With
End With
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="○"
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Scaling = 200
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size * 4 / 9
With Selection.ParagraphFormat
.BaseLineAlignment = wdBaselineAlignCenter
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Fields.ToggleShowCodes
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub |
|