Log in

View Full Version : Entering Text In A Shape In PowerPoint PPT Slide Using Excel VBA



malay
07-12-2013, 11:18 AM
Hi,

I have an existing PPT with many shapes and different text written on it. I need to remove the existing text inside the shape and enter new text in it. Please help me to solve the problem using excel vba.

Regards,

Excel Fox
07-19-2013, 08:23 PM
So this is how the hierarchy of the text property of a shape can be branched. You could substitute it with your actual variables for the application or the presentation or the slide.

So for example, if it were a variable with the name objPPT where you've got your application object, you could use


objPPT.Presentations(1).Slides(1).Shapes(1).TextFr ame.TextRange.Characters.Text = "New Text"
or if you have objSlide as your slide object, then



objSlides.Shapes(1).TextFrame.TextRange.Characters .Text = "New Text"


Depends on how your code is written. But as you can see, the hierarchy of objects is the same.