2012-11-02 62 views
0

是否有人知道如何使用vsto在powerpoint中添加金字塔smartart。 我一直在尋找它,但沒有任何運氣。任何代碼在VBA也將幫助添加金字塔Smartart

回答

2

有趣的問題。爲了添加給定類型的smartart,您需要知道要添加的smartart類型的索引。這演示瞭如何添加智能藝術,並且還爲您提供了包含每種智能藝術類型之一的演示文稿。從空白演示開始,然後刪除所有幻燈片,包括第一張幻燈片。然後執行此操作:

Sub AddSmartArtDemo() 

Dim x As Long 
Dim oSl As Slide 
With ActivePresentation 
    For x = 1 To Application.SmartArtLayouts.Count 
     Set oSl = .Slides.AddSlide(x, .Designs(1).SlideMaster.CustomLayouts(6)) 
     oSl.Shapes.AddSmartArt Application.SmartArtLayouts(x) 
    Next 
End With 

End Sub 

完成後,幻燈片1將具有SmartArt索引1的示例,依此類推。