|
1文字目を確認しながら、適用する箇条書きテンプレートを選ぶように修正してみました。
このほうが応用がきくかもしれません。
Sub test2()
Dim t1 As ListTemplate
Dim p As Paragraph
Set t1 = ListGalleries(wdNumberGallery).ListTemplates(1)
With t1.ListLevels(1)
.NumberFormat = "%1"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = MillimetersToPoints(6.6)
.Alignment = wdListLevelAlignRight
.TextPosition = MillimetersToPoints(22)
.TabPosition = MillimetersToPoints(22)
.ResetOnHigher = 0
.StartAt = 1
End With
For Each p In Selection.Paragraphs
If p.Range.Characters.First = "●" Then
p.Range.ListFormat.ApplyListTemplate _
ListTemplate:=t1, _
ContinuePreviousList:=True
p.Format.TabStops.Add Position:=MillimetersToPoints(10)
ElseIf p.Range.Characters.First = "■" Then
p.Range.Characters.First.Delete
p.LeftIndent = MillimetersToPoints(22)
Else
p.Range.ListFormat.ApplyListTemplate _
ListTemplate:=t1, _
ContinuePreviousList:=True
End If
Next
End Sub
|
|