PPT2000: How to Find the Name of an Object

ID: Q244379


The information in this article applies to:
  • Microsoft PowerPoint 2000


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, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
NOTE: The following macro examples only work from within the PowerPoint application. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, please see the following article in the Microsoft Knowledge Base:
Q230746 PPT: Viewer: Presentation Macros Don't Run Within the Viewer

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:


  5. 
    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.

Additional query words: vba ppt ppt2k 2k 2000 ppt2000 9.0 ppt9

Keywords : kbdta kbdtacode OffVBA KbVBA
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: October 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.