How to Rename a PowerPoint Object without Selection Pane

This is an obscure post, so bear with me. This is really for people who use VBA to write macros and code for PowerPoint and other Office apps that use objects the same way as PowerPoint. This is a way to take advantage of a way that PowerPoint Selection Pane works in arrays or other functions.

I found a really cool thing that I don’t want to forget how it works. Until today, I didn’t realize that Microsoft could rename objects (like text boxes, circles, rectangles, etc) in PowerPoint or other Office apps.

What happened?

So there I was, writing a flowchart in PowerPoint, with my Selection pane open. I had a bunch of rectangles on a page that were my proper steps, but they weren’t all that flow-charty. So I decided to change their shape. With my first rectangle selected, I went to

Drawing Tools > Insert Shape Group > Edit Shape > Change Shape > [select a shape]

Lazily (or so I’d thought!), I hadn’t renamed my objects before I’d started animating them. I hovered over each object (see image below, trying to relearn flowcharting by way of the object names.

I changed my Rectangle object to a Flowchart: Decision object. And on my Selection Pane, the object name changed from Rectangle 33 to Flowchart: Decision 33.

BIG LOOKOUT: It changes the name of the object. If it changes the name, any VBA or other links to that object will break.

Before
After

I tried the same thing on a Rectangle object I’d renamed to chatPanel, and nothing happened when I changed the object type. I then tried to change 33 to a different number, and that also broke the connection.

Why does this matter?

A few wonderful things clicked in my head when I saw this:

  1. Changing to the proper object gives you a decent starting point for naming in Selection Pane
  2. If you leave the names alone (don’t rename it in Selection Pane), it will let you manipulate more objects by code easier. I can see reasons for doing both.

For example, let’s say that I went back and changed all of my Rectangle objects with Flowchart: Process objects, which are just rectangles anyways. I change the shape object to the actual Action Button: Forward or Next, which changes the name in the selection panel from Rectangle 7 to Flowchart: Process 7.

On the surface, it does nothing.

Later, I want to change the formatting to all of my flowchart objects. Or, I want to animate them in. Or I want to make an interactive quiz in VBA. This would allow me to write a function instead of inline code, so I can write a conditional statement if it’s a flowchart: object, call doSomethingToMyFlowchartObjects.

I won’t lie – I just found this functionality and am not sure how to use it. I don’t know the ins and outs. But… I do love writing macros and making things more efficient. I hope to share a real-life use case for it soon! In the meantime, write one in the comments if you’ve got one.

Cheers!

Leave a comment