View Single Post
 
Old 08-11-2023, 02:05 AM
JavierA JavierA is offline Windows 10 Office 2021
Novice
 
Join Date: Aug 2023
Posts: 2
JavierA is on a distinguished road
Default

Thank you JohnWilson for your post.

This is my code,
Sub ChangeTextTransparency()

Dim Slide As Slide
Dim shape As shape
Dim paragraph As TextRange
Dim letter As TextRange

Dim slidenumber As Integer
slidenumber = 8

Dim textBoxIndex As Long
textBoxIndex = 1

Set Slide = ActivePresentation.Slides(slidenumber)

If textBoxIndex <= Slide.Shapes.Count And textBoxIndex > 0 Then
Set shape = Slide.Shapes(textBoxIndex)
If shape.HasTextFrame Then
For Each paragraph In shape.TextFrame.TextRange.Paragraphs
For Each letter In paragraph.Characters
letter.Paragraphs.Characters.Select
ActiveWindow.Selection.TextRange2.Characters.Font. Fill.transparency = Rnd
Next letter
Next paragraph
End If
End If

End Sub

My problem is when I start the presentation.
As you know to use ActiveWindow.Selection... you should have something selected.
I have selected each letter with letter.Paragraphs.Characters.Select and then
ActiveWindow.Selection.TextRange2.Characters.Font. Fill.transparency = Rnd.
I put this code in a Slide8 Objet with Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow) but it doesn't work in Presentation mode.
When I am in Presentation mode and I am on slide 8 (where I need the code to be executed)
Does the Selection Objet work in Presentation mode?
Reply With Quote