直到现在我自己解决了我的大部分问题/问题,只是搜索已经存在的线程......不幸的是这对我当前的问题不起作用,所以我想我试一试:
我是 VBA 新手,最近才开始编写一些有用的 marcos 来自动化/简化 PowerPoint 2007 上的幻灯片开发。
在其中一个中,我试图将形状添加到带有预定义项目符号列表的幻灯片中。一切正常,除了让子弹的缩进正确。我不确定要使用哪个代码...
我想要做的是一方面定义项目符号和文本之间的空间,另一方面为项目符号列表的不同级别设置项目符号之前的缩进。
我非常感谢您的帮助或任何指向解决此问题的线程的链接。
到目前为止开发的代码见下文:
Sub PhaseWiz1Row2Phases()
Dim sld As Slide
Dim SlideIndex As Integer
Dim row1 As Shape
'###Only apply command to currentlty viewed slide###
'set the index number of the currently viewed slide as the variable "SlideIndex"
SlideIndex = ActiveWindow.View.Slide.SlideIndex
'set sld as the current slide
Set sld = ActivePresentation.Slides(SlideIndex)
'###Add and configure shapes to currently viewed slide###
'add first column to the currently viewed slide
Set row1 = sld.Shapes.AddShape(msoShapeRectangle, _
Left:=35.999, Top:=195.587, Width:=308.971, Height:=120)
'configure column
row1.Fill.Visible = msoFalse
row1.Line.Visible = msoTrue
row1.Line.Weight = 1#
row1.Line.ForeColor.RGB = RGB(0, 40, 104)
'Add and configure text
row1.TextFrame.TextRange.Text = "Headline" _
+ Chr$(CharCode:=13) + "Text" + Chr$(CharCode:=13) + "Text" _
+ Chr$(CharCode:=13) + "Text" + Chr$(CharCode:=13) + "Text"
row1.TextFrame.TextRange.Font.Size = 14
row1.TextFrame.TextRange.Font.Name = "Verdana"
row1.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignLeft
row1.TextFrame.VerticalAnchor = msoAnchorTop
row1.TextFrame.TextRange.Paragraphs(3).IndentLevel = 2
row1.TextFrame.TextRange.Paragraphs(4).IndentLevel = 3
row1.TextFrame.TextRange.Paragraphs(5).IndentLevel = 4
With row1.TextFrame.TextRange.Characters(1, 8)
.Font.Color.RGB = RGB(0, 174, 239)
.Font.Bold = msoTrue
End With
With row1.TextFrame.TextRange.Characters(9, 16)
.Font.Color.RGB = RGB(0, 40, 104)
.Font.Bold = msoFalse
End With
With row1.TextFrame.TextRange.Characters(10, 0)
.ParagraphFormat.Bullet.Character = 8226
.ParagraphFormat.Bullet.RelativeSize = 0.7
End With
With row1.TextFrame.TextRange.Characters(15, 0)
.ParagraphFormat.Bullet.Character = 45
.ParagraphFormat.Bullet.RelativeSize = 1.2
'.Paragraphs(3).IndentLevel = 2
End With
With row1.TextFrame.TextRange.Characters(20, 0)
.ParagraphFormat.Bullet.Character = 43
'.Paragraphs(3).IndentLevel = 2
End With
With row1.TextFrame.TextRange.Characters(25, 0)
.ParagraphFormat.Bullet.Character = 46
End With
结束子