Probably a very stupid question but I can't figure how to rename an object in PowerPoint.. For example, all my Graphs are called by default "Graph 1" etc. Could someone help me on that? Thanks!
相关问题
- Converting byte array output into Blob corrupts fi
- How to open Powerpoint using VBA
- Passing a namespace into a function
- How to name and reference an Excel range using off
- Using a 32bit COM object in a 64bit environment
相关文章
- Directly signing an Office Word document using XML
- How to programmatically read and change slide note
- Excel merge cell date and time
- What Component IDs should I search for to detect w
- Diff for Powerpoint
- Clear Microsoft Office Add-Ins cache
- How can I load another new Word document in the sa
- Word 2007 macros: is there an OnPrint event I can
Thanks for your help but actually I am just doing it using VBA...
Cheers
In PowerPoint 2007 you can do this from the Selection pane.
To show the Selection pane, click on the Home tab in the ribbon, then click on Arrange and then 'Selection Pane...' at the bottom. The Selection pane will open on the right. (Or press CTRL+F10)
To rename an object, first select the object and then double click on the object name in the Selection pane and you will be able to type the new object name.
(This answer assumes you are merely assigning more meaningful names during development, so your other code that references the objects can be more readable).
Put the code below into a sub, then run it from the slide in question. Each shape will be selected in turn, so you can see what shape is being referenced. An input box will tell you the current name and ask you for a new name. If you cancel or OK a zero-length input, the old name will stay in place. There is no name entry validation in this code, so be sure you type only valid names. After running it once, you can run it again just to check that the names you typed in the first round were applied to the object you intended.
The loop will cover all objects on the current slide, so if you want to process multiple slides, you have to run this separately on each slide. Every object on the slide is considered: title, drawing objects, groups, embedded pictures, equations, etc. etc. - just don't type a new name for objects that you don't care.
After your development is finished, best hide (Private Sub) or erase this code, so your users don't change object names by mistake.