|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
* 楼主:请选定要转换的文字(制表位这块儿不太懂,如果有问题得等sylun老师等来解决)后应用:
- Sub AutoNum_Set()
- Dim r As Range
- With Selection
- If .Type = 1 Then MsgBox "Not-Select!", 0 + 16: End
- If Asc(.Characters.Last.Previous.Text) = 12 Then .MoveEnd 1, -2
- If Asc(.Characters.Last.Previous.Text) = 13 Then .MoveEnd 1, -1
- Set r = .Range
- End With
- With r
- .MoveStart 1, -1
- .Find.Execute "(^13)(\[[0-9]{1,}\]^9)", , , 1, , , , , , "\1", 2
- .MoveStart
- .Select
- .ParagraphFormat.TabStops.ClearAll
- End With
- With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1)
- .NumberFormat = "[%1]"
- .TrailingCharacter = wdTrailingTab
- .NumberStyle = wdListNumberStyleArabic
- .NumberPosition = CentimetersToPoints(0)
- .Alignment = wdListLevelAlignLeft
- .TextPosition = CentimetersToPoints(1.25)
- .TabPosition = CentimetersToPoints(0)
- .ResetOnHigher = 0
- .StartAt = 1
- .LinkedStyle = ""
- End With
- ListGalleries(wdNumberGallery).ListTemplates(1).Name = ""
- Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
- ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
- True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
- wdWord10ListBehavior
- End Sub
复制代码 |
|