PDA

View Full Version : Text box alter while viewing show



10redmoe
05-30-2011, 09:50 AM
:banghead: Hi,
I am quite annoyed at the at the fact that when I write a macro to change text, then add a action button to do that macro, in the middle of showing a presentaion, that it doesn't work. Please can you get my text to change whilst showing slideshow.
: pray2:
:help .
Please help!
p.s. i am using powerpoint 2003
p.p.s. my code is (whole module coming but the bit I'm annoyed about is in red):

Option Explicit
Public x As Integer
Sub Shape1_MovementLeft()
With ActivePresentation.Slides(1).Shapes(1)
.Left = .Left - x
End With
End Sub

Sub Shape1_MovementUp()
With ActivePresentation.Slides(1).Shapes(1)
.Horizontal = . 10
End With
End Sub

Sub Shape1_MovementRight()
With ActivePresentation.Slides(1).Shapes(1)
.Left = .Left + x
End With
End Sub

Sub Shape1_MovementDown()
With ActivePresentation.Slides(1).Shapes(1)
.Down = .Down - 10
End With
End Sub

Sub ChangeX_UP()
x = x + 1
ActiveWindow.Selection.SlideRange.Shapes("Text Box 14").TextFrame.TextRange.Text = ("Movement = " & x)
DoEvents
End Sub

Sub ChangeX_Down()
x = x - 1
ActiveWindow.Selection.SlideRange.Shapes("Text Box 14").TextFrame.TextRange.Text = ("Movement = " & x)
DoEvents
End Sub

Sub ResetX()
x = 20
]ActiveWindow.Selection.SlideRange.Shapes("Text Box 14").TextFrame.TextRange.Text = ("Movement = " & x)
DoEvents
End Sub

John Wilson
05-30-2011, 11:02 AM
Not sure why you are annoyed. Any code that depends on Selection will ALWAYS fail in show mode because it's impossible to select anything in that mode. Try SlideShowWindows(1).View.Slide.Shapes("TextBox 14").TextFrame.TextRange=

Also .Horizontal and .Down are valid commands??? (I don't think they are)

Maybe if you explain exactly what you need to happen we can fix the rest.

10redmoe
05-31-2011, 10:35 AM
It worked! Cheers! I am a newbie so am a bit stupid with VBA.
:bow: down to all you VBA geeks!