【发布时间】:2022-01-18 02:53:18
【问题描述】:
我正在尝试使用三种项目符号缩进样式自动格式化一系列表格。
1 - 没有缩进,没有项目符号 2 - 没有缩进,项目符号 3 - 缩进,破折号
当我手动设置它时:
段落对话框中的手动输入(以 cms 为单位) 1 - 0 文字前,0 悬挂 2 - 文字前 0,5,悬挂 0,5 3 - 1,0 文字前,0,5 悬挂
我修改了以下代码,但它没有给我想要的结果。
Sub TableBullets2()
Dim I As Integer
With Application.ActiveWindow.Selection
If .Type = ppSelectionText Then
I = 1
For I = 1 To .TextRange2.Paragraphs.Count
With .TextRange2.Paragraphs(I)
Select Case .ParagraphFormat.IndentLevel
Case Is = 1
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.FirstLineIndent = 0
.ParagraphFormat.LeftIndent = 0
With .ParagraphFormat.Bullet
.Visible = False
With .Font
.Name = "Arial"
.Fill.ForeColor.RGB = RGB(0, 0, 0)
End With
.Character = 8226
End With
Case Is = 2
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.FirstLineIndent = cm2Points(-0.5)
.ParagraphFormat.LeftIndent = cm2Points(0.5)
With .ParagraphFormat.Bullet
.Visible = msoTrue
With .Font
.Name = "Arial"
.Fill.ForeColor.RGB = RGB(0, 0, 0)
End With
.Character = 8226
End With
Case Is = 3
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.FirstLineIndent = cm2Points(-0.5)
.ParagraphFormat.LeftIndent = cm2Points(1.0)
With .ParagraphFormat.Bullet
.Visible = msoTrue
With .Font
.Name = "Arial"
.Fill.ForeColor.RGB = RGB(0, 0, 0)
End With
.Character = 8211
.RelativeSize = 0.9
End With
End Select
End With
Next I
End If
End With
End Sub
你能帮我弄清楚吗?
提前谢谢你。
【问题讨论】:
标签: vba formatting powerpoint