PPT2000: How to Find the Name of an Object (244379)



The information in this article applies to:

  • Microsoft PowerPoint 2000

This article was previously published under Q244379

SUMMARY

When working with several shapes, frames, or other objects, it is best to work with the shape's name, rather than its index position, because the index can vary with the shape's layer. This article describes how to find an object's name.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

Getting Object Names

Although you can work with the index position for visible objects, if you plan to hide and make visible a shape or text frame, find out the name of the object as follows:
  1. In slide view, click to select the shape or frame whose name you want to retrieve.
  2. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  3. If the Immediate window is not visible, click Immediate Window on the View menu.
  4. Type the following line of code in the Immediate window, and press ENTER:
    Debug.Print ActiveWindow.Selection.ShapeRange.Name
    					
This returns the name of the selected object, and prints it below the command. This is the actual name of the selected slide object.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbdtacode kbhowto kbProgramming KB244379