Translation in PPT

B

BrianF

I frequently translate PowerPoint presentations from French or Dutch into
English but I do get tired of having to highlight every slide to change the
language for checking purposes. It is so easy in MS-Word, where 'Select all'
means the whole document. In ppt, it only means the whole slide.
Is there any way of selecting all slides and changing the editing language
overall?

Thanks,

Brian
 
G

Guest

A little vba is the answer!


Sub Lingo()

Dim osld As Slide
Dim oshp As Shape

For Each osld In ActivePresentation.Slides
For Each oshp In sld.Shapes
If oshp.Type = msoTextBox Or msoPlaceholder Then
If oshp.HasTextFrame Then
oshp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
End If
Next
Next
End Sub
--
Don't know how to use vba?? See here:
http://www.rdpslides.com/pptfaq/FAQ00033.htm

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
B

BrianF

John Wilson said:
A little vba is the answer!


Sub Lingo()

Dim osld As Slide
Dim oshp As Shape

For Each osld In ActivePresentation.Slides
For Each oshp In sld.Shapes
If oshp.Type = msoTextBox Or msoPlaceholder Then
If oshp.HasTextFrame Then
oshp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
End If
Next
Next
End Sub
--
Don't know how to use vba?? See here:
http://www.rdpslides.com/pptfaq/FAQ00033.htm

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
Thanks so much John for your fast response. I have no knowledge of vba but I
will certainly give it a try and report back. As I am in Europe, that will
be tomorrow.

Brian
 
B

BrianF

John Wilson said:
A little vba is the answer!


Sub Lingo()

Dim osld As Slide
Dim oshp As Shape

For Each osld In ActivePresentation.Slides
For Each oshp In sld.Shapes
If oshp.Type = msoTextBox Or msoPlaceholder Then
If oshp.HasTextFrame Then
oshp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
End If
Next
Next
End Sub
--
I guess I must be doing something wrong. When I try to run this macro in my
presentation I get Error 424. Then I click on Debug and it highlights the
line:

For Each oshp In sld.Shapes

Does that mean anything to you?

Thanks,

Brian
 
S

Steve Rindsberg

I guess I must be doing something wrong. When I try to run this macro in my
presentation I get Error 424. Then I click on Debug and it highlights the
line:

For Each oshp In sld.Shapes

Does that mean anything to you?

Change it to osld.Shapes (from sld.Shapes)
 
B

BrianF

BrianF said:
That did it.
Sorry to have to retract that. It seems that it only works on some slides
but not all. In fact, it seems that it does not work when there is more than
one text box on a slide.
Unfortunately I don't have a clue in vba so any further help would be
appreciated.

Thanks,

Brian
 
S

Steve Rindsberg

Sorry to have to retract that. It seems that it only works on some slides
but not all. In fact, it seems that it does not work when there is more than
one text box on a slide.
Unfortunately I don't have a clue in vba so any further help would be
appreciated.

Are your text boxes really text boxes or might some of them be autoshapes?
Let's try it like so:

Sub BingoLingo()
Dim osld As Slide
Dim oshp As Shape

For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
' no more fooling around. If it has text, whack it
If oshp.HasTextFrame Then
oshp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next ' Shape
Next ' Slide

End Sub
 
B

BrianF

Steve Rindsberg said:
Are your text boxes really text boxes or might some of them be autoshapes?
Let's try it like so:

Sub BingoLingo()
Dim osld As Slide
Dim oshp As Shape

For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
' no more fooling around. If it has text, whack it
If oshp.HasTextFrame Then
oshp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next ' Shape
Next ' Slide

End Sub
That indeed seems to have done the trick. It makes me want to know more
about vba.

Many thanks,

Brian
 
B

BrianF

BrianF said:
That indeed seems to have done the trick. It makes me want to know more
about vba.
The next question that arises for me is, "Is there a repid way to insert
that macro in any presentation rather than having to go the copy and paste
route?"
The thing is, I work in some ppt files that need translation into English
and others that have to be translated. The macro only needs to run after
translation so it would be useful to have a quick way of running it without
having to find the text file and then copy/paste it into the VBA editor
every time.

Many thanks,

Brian
 
G

Guest

This can be adapted as an add in which will run from the menu. Sorry about
the typo sld for osld by the way. When Ive got chance I'll email it to you
(if thats not your real email buzz me at john AT SIGN technologytrish.co.uk
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
S

Steve Rindsberg

The next question that arises for me is, "Is there a repid way to insert
that macro in any presentation rather than having to go the copy and paste
route?"

Two ways:

The simplest is to save this and any other useful macros you accumulate in a
single PPT file which you can open and leave open while you're working on other
files. You can run macros from any currently open file.

You can also add a new toolbar and customize buttons onto it to run your
macros. With versions of PPT 2000 and up, as long as PPT can find the ppt file
that contains the macros customized onto the buttons, it'll load it and run the
macro when you click one of the buttons. Not the sort of thing I'd suggest if
you want to distribute the code to others, but for your own use, it's quite
handy, since you don't even need to have the file open. It will be a bit
slower (it opens the file with the macros each time you click the button) and
will give you a macro security warning each time, depending on your security
settings, but that's not a bad price to pay for the simplicity of it all.

More work but more convenient in the long run is to convert your macros to an
add-in:

Creating and Installing Add-ins, Toolbars, Buttons
http://www.pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars
-_Buttons_

I'd be inclined to go with the first solution until you're quite sure the
code's stable and won't be added-to/altered often. Then consider doing an
addin.
 
B

BrianF

BrianF said:
The next question that arises for me is, "Is there a repid way to insert
that macro in any presentation rather than having to go the copy and paste
route?"
The thing is, I work in some ppt files that need translation into English
and others that have to be translated. The macro only needs to run after
translation so it would be useful to have a quick way of running it
without having to find the text file and then copy/paste it into the VBA
editor every time.
I think I had a bout of Alzheimer there. What I really meant was:
The thing is, I work in some ppt files that are already in English and
others that have to be translated. The macro only needs to run after
translation so it would be useful to have a quick way of running it
without having to find the text file and then copy/paste it into the VBA
editor every time.

Brian
 
S

Steve Rindsberg

I think I had a bout of Alzheimer there. What I really meant was:

Same difference from the macro's point of view. <g>

See my answer to your previous post
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top