2016-07-26 27 views
0

我有许多形状的演示文稿,并且想将它们命名为“MyPicture#”,其中#是一个数字。例如形状65将被命名为MyPicture65。 VBA能做到这一点吗?那么如何?如何命名所有形状

+1

对不起,无法抗拒:https://imgflip.com/i/17zbfc – Comintern

回答

0
Sub test() 

    Dim sld   As Slide 
    Dim shp   As Shape 
    Dim lctr  As Long 

    For Each sld In ActiveWindow.Presentation.Slides 
     For Each shp In sld.Shapes 
      lctr = lctr + 1 
      shp.Name = "MyPicture" & lctr 
     Next 
    Next 


End Sub 
+0

代码工作完美。不过,我现在看到,标题和更多也获得了名称“MyPicture#”。有没有办法限制只有外部来源的形状? – Orongo

相关问题