问题
Please check below screenshot & code. It has my questions and code I have written so far (which is failing)
Below is my code:
Private Sub VerticalBlockList()
Dim oPPT As PowerPoint.Application
Dim oPres As PowerPoint.Presentation
Const ppLayoutTitleAndContent As Byte = 32
Set oPPT = CreateObject("Powerpoint.Application")
Set oPres = oPPT.Presentations.Add()
Dim layout As SmartArtLayout
Set layout = Application.SmartArtLayouts(26)
With oPres.Slides.Add(oPres.Slides.Count + 1, ppLayoutTitleAndContent)
With .Shapes.AddSmartArt(layout, 30, 180, 318, 252)
With .SmartArt
.Nodes(1).Shapes(1).TextFrame2.TextRange.Text = "Sample-1"
.Nodes(1).Shapes(2).TextFrame2.TextRange.Text = "Sample-2"
' Below statement throws error.
' basically I want to move the bullet section to little bit on left so that the bullet points doesn't show up
' P.S. there is no way I can remove that bullet in a Vertical Block List
.Nodes(1).Shapes(2).left = .Nodes(1).Shapes(2).left - 30
End With
End With
End With
End Sub
回答1:
No need to move the shape, you can just remove the bullets:
.Nodes(1).Shapes(2).TextFrame2.TextRange.ParagraphFormat.Bullet.Type = msoBulletNone
来源:https://stackoverflow.com/questions/42400785/powerpoint-vba-move-chldnode-of-vertical-block-list-to-the-left