How to name an object within a PowerPoint slide?

前端 未结 5 2098
滥情空心
滥情空心 2020-12-02 16:42

So I know how to name a textbox, or a like object in PowerPoint with VB, but I was wondering if there was a way to name objects through the Ribbon (PowerPoint 2007). For ins

相关标签:
5条回答
  • 2020-12-02 17:15

    Click Insert ->Object->Create from file ->Browse.

    Once the file is selected choose the "Change icon" option and you will be able to rename the file and change the icon if you wish.

    Hope this helps!

    0 讨论(0)
  • 2020-12-02 17:22

    While the answer above is correct I would not recommend you to change the name in order to rely on it in the code.

    Names are tricky. They can change. You should use the ShapeId and SlideId.

    Especially beware to change the name of a shape programmatically since PowerPoint relies on the name and it might hinder its regular operation.

    0 讨论(0)
  • 2020-12-02 17:23

    Yes. Click on the object (textbox, shape, etc.) to select the object and in the Drawing Tools | Format tab, click on Selection Pane in the Arrange group. From there, you'll see names of objects - you can double click (or press F2) on any name and rename it. By deselecting it, it becomes renamed. You can also get to this from the Home tab -> Drawing group -> Arrange drop-down -> Selection pane or by pressing ALT + F10.

    0 讨论(0)
  • 2020-12-02 17:27

    THIS IS NOT AN ANSWER TO THE ORIGINAL QUESTION, IT'S AN ANSWER TO @Teddy's QUESTION IN @Dudi's ANSWER'S COMMENTS

    Here's a way to list id's in the active presentation to the immediate window (Ctrl + G) in VBA editor:

    Sub ListAllShapes()
    
        Dim curSlide As Slide
        Dim curShape As Shape
    
        For Each curSlide In ActivePresentation.Slides
            Debug.Print curSlide.SlideID
            For Each curShape In curSlide.Shapes
    
                    If curShape.TextFrame.HasText Then
                        Debug.Print curShape.Id
                    End If
    
            Next curShape
        Next curSlide
    End Sub
    
    0 讨论(0)
  • 2020-12-02 17:32

    Select the Object -> Format -> Selection Pane -> Double click to change the name

    0 讨论(0)
提交回复
热议问题