Changing text in Powerpoint using vba

Hello Experts,

I have a Powerpoint 2003 presentation with English text but I would like to add some sort of macro/vba that will automatically change the text to another language. (I have 3 or 4 languages to consider)

The presentation contains text and pictures, only the text is to change.

I intend to store the text or phrases in an excel table for example.
I can store the text as a "text block" in 1 excel row for each slide (use the columns for each language), but I am unsure how the bullet marks in the text box will react to this

thanks.
 
PufinAsked:
Who is Participating?
 
Chris BottomleyConnect With a Mentor Software Quality Lead EngineerCommented:
Modified quickly to avoid the names ... at least for now as attached - tested in ppt 2003 and 2007.

Chris
xltoNewPPT-1-.xls
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
>>> but I am unsure how the bullet marks in the text box will react to this

Can you clarify, there is no reason, (in my limited experience) that the text cannot be simply replaced as long as we have a mechanism to link the existing text.

Either a stored record indicatinhg the 'current language to support replacements or a record of the structures, Text boxes etc and a dynamic population of them from an excel sheet.

Of the two the first is probably easiest with the second being more flexible but potentially a lot of work to develop.

If you want to proceed in this way then a sample would be useful to see the constructs used.

Chris
0
 
PufinAuthor Commented:
Thanks - the bullets comment is not so important.
I am a little vague - since I have just started this topic and am usure which way to proceed

The files I am using are nothing complexed - although it might get more advanved latter. The powerpoint slides are just standard slides with a title, a text box and a picture object. I was just thinking of say 3 buttons on the first slide to be clicked - this then causes the other slides to be populated with one of the 3 languages. The excel file is also a simple single table.

I need some way to identfy each slide and each correponding text box and tilte box (is this just a text box) so I know which text to relplace it with (I think).

rgs.

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Chris BottomleySoftware Quality Lead EngineerCommented:
>>> I need some way to identfy each slide and each correponding text box and tilte box (is this just a text box) so I know which text to relplace it with (I think).

Each slide has an id that can be used either the slide order or a slide identity so the identify slide will work.

Each textbox etc.  They are somewhat uncontrolled  can all be named and can all have one or more identifying marks so again that is viable.

The essence is therefore a list i.e. excel of the titles and text associated with each where the text can be indexed to a language column.

It might be a lot more than 1 question though so how to proceed and how much you are capable of yourself is the issue.

Chris
0
 
PufinAuthor Commented:
OK - thanks -

can you show me how to identify the ID for each slide or the ID for each object on the slides so I can make a list, then use this info to populate an excel table. I will then fill the text (3 languages) into the excel and the re populate the slide to the corresponding ID number.
Can one re name the textboxes in to a more logical sequence.

I think I can do the bit to transfer text from excel and back to the slide (if not then this will be a new question) - it is the box identinfication I have a problem with.

I noted the when I add a new text box - its indicator - eg "rectangle 3" is very unpredicable. the next text box was called  "rectangle 14" (os near to this) - I am unsure of the item number and ID, perhaps it is best to use slide index - just in case I add more text boxes to slide and refer to each as - eg Slide1Box1, Slide1Box2, Slide2Box1 Slide2Box2 Slide2Box3  etc.
rgs,
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
I'm trying to put together a sample which may not answer everything but perhaps enough to set you off.

Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
As an example to help you ebvaluate a way forward, the following SS does a simple generation of an automated PPT file, (NO SAVE) according to the actual language selected in A2.  Complexity will escalate when trying to support different constructs.

I will now try and evaluate a way of editing an existing PPT and advise how it looks.

Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Now with added file!
xltoNewPPT.xls
0
 
PufinAuthor Commented:
Having problem with the line near the end

sld.Shapes(ThisWorkbook.Worksheets("Sheet2").Range("e" & rw).Text).TextFrame.TextRange.Text

object does not exist ?

rgs,
0
 
PufinAuthor Commented:
ahh

The first title box is called "Rectangle 2" thus the confusion. I need to sort out this hap-hazard namining of shapes somehow.

0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Unsurprisingly I tested before posting so can you say what you might have changed?

Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Probably a version difference BUT easily resolved and at least this way because the document is generated on the fly there would never be an issue.

Conceptually if the principle works for you then you can expand the concept and extend the capabilities with a new question if necessary ... and I would expect this to be so over time.

Chris
0
 
PufinAuthor Commented:
Yes it functioned now. As you mentioned I need to work on it a little more - I have more basic ideas and concepts on how to move forward and that was my main aim.
Thanks for your help.
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Any reasonable challenge is welcome and this an area that intrigues me so thank you for the bite sized problem.

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.