K
Keith R
I have 4 stacked rectangles that are all the same size, which have
textframes in them.
When a user clicks on the topmost (and therefore visible) rectangle, I send
it "to back" to reveal the next rectangle below. A user can cycle through
these 4 boxes as many times as needed. I'm using Shyam's code at
http://www.mvps.org/skp/ppt00040.htm#2
Now I'd like to take the text of a newly revealed rectangle and put it on a
second slide, so that the user can see the text in a larger font than will
fit in the source rectangle.
I used the mouseover event to get the text from the rectangle that gets
revealed, without clicking on it (because that would send that box to the
back).
I only want the text of the rectangle that gets revealed, so I created a
global variable that "locks" once it has that first set of text. As soon as
the top rectangle dissapears, it fires the mouseover event for the
rectangle below and gives me the first messagebox (see code below) with the
correct text in it, but the rest of the code does not seem to be working- I
welcome any ideas or feedback on how to accomplish this...
thanks,
Keith R
Public TextCaptured As Boolean
'------------------------------------------------
Sub GrabText(oShp As Shape)
Dim NewText As String
If TextCaptured = False Then
NewText = oShp.TextFrame.TextRange
MsgBox NewText
ActiveWindow.View.GotoSlide Index:=2
' it never goes to slide 2-
' is this some kind of interaction with the mouseover event?
MsgBox "1" 'testing to see if the code got this far, but it never fires
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
MsgBox "2" 'never fires
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
MsgBox "3" 'never fires
ActiveWindow.Selection.TextRange.Text = NewText
TextCaptured = True
End If
End Sub
textframes in them.
When a user clicks on the topmost (and therefore visible) rectangle, I send
it "to back" to reveal the next rectangle below. A user can cycle through
these 4 boxes as many times as needed. I'm using Shyam's code at
http://www.mvps.org/skp/ppt00040.htm#2
Now I'd like to take the text of a newly revealed rectangle and put it on a
second slide, so that the user can see the text in a larger font than will
fit in the source rectangle.
I used the mouseover event to get the text from the rectangle that gets
revealed, without clicking on it (because that would send that box to the
back).
I only want the text of the rectangle that gets revealed, so I created a
global variable that "locks" once it has that first set of text. As soon as
the top rectangle dissapears, it fires the mouseover event for the
rectangle below and gives me the first messagebox (see code below) with the
correct text in it, but the rest of the code does not seem to be working- I
welcome any ideas or feedback on how to accomplish this...
thanks,
Keith R
Public TextCaptured As Boolean
'------------------------------------------------
Sub GrabText(oShp As Shape)
Dim NewText As String
If TextCaptured = False Then
NewText = oShp.TextFrame.TextRange
MsgBox NewText
ActiveWindow.View.GotoSlide Index:=2
' it never goes to slide 2-
' is this some kind of interaction with the mouseover event?
MsgBox "1" 'testing to see if the code got this far, but it never fires
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
MsgBox "2" 'never fires
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
MsgBox "3" 'never fires
ActiveWindow.Selection.TextRange.Text = NewText
TextCaptured = True
End If
End Sub