?
Solved

Changing text in Powerpoint using vba

Posted on 2009-04-16
14
Medium Priority
?
327 Views
Last Modified: 2013-11-25
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.
 
0
Comment
Question by:Pufin
  • 9
  • 5
14 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24155825
>>> 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
 

Author Comment

by:Pufin
ID: 24156066
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156113
>>> 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Pufin
ID: 24156262
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156294
I'm trying to put together a sample which may not answer everything but perhaps enough to set you off.

Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156508
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156516
Now with added file!
xltoNewPPT.xls
0
 

Author Comment

by:Pufin
ID: 24156783
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
 

Author Comment

by:Pufin
ID: 24156867
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156884
Unsurprisingly I tested before posting so can you say what you might have changed?

Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24156904
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
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 2000 total points
ID: 24156987
Modified quickly to avoid the names ... at least for now as attached - tested in ppt 2003 and 2007.

Chris
xltoNewPPT-1-.xls
0
 

Author Closing Comment

by:Pufin
ID: 31570885
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24157883
Any reasonable challenge is welcome and this an area that intrigues me so thank you for the bite sized problem.

Chris
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In all recent versions of PowerPoint it is possible to trigger animations. This means the animation takes place when a certain shape is clicked. This allows you to run animation “on demand” and outwith the normal sequence of mouse cl…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question