Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Capture Text in Animation Order (any)

    Hi Again,

    As a followup to my post on running a slide show not maximized, another way to get a running start at capturing the material I wanted would be to copy the material from each of the text shapes that defines a step.

    More specifically, I have a slide (actually several) where the slide has 30 callouts describing a sequential process. In slide show view, each callout has text describing what happens in that step. When you go to the next step (mouse click), the callout for the previous step disappears to be replaced by the callout for the next step. Until you finish all the steps on the slide. Then on to the next slide where the sequence repeats itself.

    In slide view, the slide is a mess and you can't even tell what the order of steps are since the callouts cover each other. (I didn't prepare these slides but I do pity the person who did.)

    What I would like to do is be able to copy the text of each callout in the order of the callouts - preferably to a Word document. To me, that means somehow looking at the callout shapes on the slide in the order of animation. The Word document might have something like:
    Slide #x: [maybe include title of slide]
    Step 1: [text from callout animated first]
    Step 2: [text from callout animated second]
    Step n:...

    Slide #x+1
    Step 1: [text...]

    Slide #x+2:
    if no animated shapes with text, then a msg to that effect

    To generalize this, the animated objects don't have to be just callouts. Text boxes or other shapes containing text could have been used. May be useful to indicate the shape type if possible.

    Any ideas?

    TIA

    Fred

  2. #2
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Beddau, Mid Glamorgan, Wales
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture Text in Animation Order (any)

    Fred:

    Assuming that the objects have been added to the slide in the order in which they are revealed, using TAB to select the objects one after the other should work. It won't necessarily reveal each object, so commands may have to be used 'blind'. The sequence is:

    1. TAB to select object.
    2. EDIT/TEXT OBJECT to select the text on the object.
    3. CTRL/C to copy the text.
    4. TAB to select next object etc.

    In XP, you would have to stop after 24 objects, to paste them all into Word; in 2000, pause after 12. In 97 of course you would have to move to Word and paste each text as part of the sequence.

    If you have loads of slides, it might be worth macro-ing it.

    Tony.
    Regards,

    Tony
    [s] [/s]
    www.SylviArtist.com

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Here is a simple Macro to get you started. It stores all the text from slide 1 into a variable called strAllText in the correct order.
    Grouped objects will be ignored.

    Do you need help pasting this into Word?

    StuartR
    <font face="Georgia">
    Public Sub CopyText()
    Dim shpNext As Shape
    Dim strText() As String
    Dim strAllText As String
    Dim i As Integer

    ReDim strText(ActivePresentation.Slides(1).Shapes.Count)

    For Each shpNext In ActivePresentation.Slides(1).Shapes
    If Not shpNext.AnimationSettings.Animate Then
    If shpNext.TextFrame.HasText Then
    i = i + 1
    strText(i) = shpNext.TextFrame.TextRange.Text
    End If
    End If
    Next shpNext

    For Each shpNext In ActivePresentation.Slides(1).Shapes
    If shpNext.AnimationSettings.Animate Then
    If shpNext.TextFrame.HasText Then
    strText(i + shpNext.AnimationSettings.AnimationOrder) = shpNext.TextFrame.TextRange.Text
    End If
    End If
    Next shpNext

    For i = 1 To UBound(strText)
    If strText(i) <> "" Then
    strAllText = strAllText & strText(i) & vbCrLf
    End If
    Next i

    MsgBox strAllText

    End Sub
    </font face=georgia>

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Hi Stuart,

    Thanks for the macro. Thanks also to Tony for the tabbing idea but I had already resolved that a macro was needed, as Tony suggested, bcs of the large number of animated items (about 30 at least) and the difficulty of seeing them and that this was needed over several slides.

    I think the macro is right on. For my needs, it probably is not necessary to capture the text from objects that are not animated. I just needed the callouts to capture the steps. So I could probably eliminate the first loop.

    I had tried recording a macro where I recorded the step of animating an existing object. There was no code generated. So I thought I had run into a brick wall. I see that the animation order is a property of the object but not sure why the macro recorder didn't do anything. Maybe it did but I guess I wasn't looking in the right place. I also see how you're making use of the array as you loop thru the objects in their creation order, fill the strText array first with the text from non-animated objects in the first loop, then store the text of animated objects in the animation order. In my case, the last loop would just fill strAllText with items that are animated. Whenever a null value is found in the strText array item (a non-animated shape with text, in my case, or an object with no text), that item is skipped.

    So yes, I'd ask for 2 enhancements:
    - also record the animation order so the array item would read something like
    1. empty the box
    2. sort the contents
    3. ...
    I know I could do this myself
    - paste the string into a new Word document. This I don't know how to do altho I've seen lots of code samples in the lounge that does this sort of thing.

    Also, if I wanted to check the type of object before recording the text (I only wanted to do callouts), where do I find a list of values to test the shape against and what property of the object do I test (looks like shpnext.AutoShapeType)?

    Fred

    Fred

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Fred,

    It's 05:30 AM and I am about to leave for work, I will try to address some of your quesitons when I get home tonight - unless someone else wants to do so before then.

    StuartR

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    The macro got a bit big, so here it is as a text file.

    I'm sure the Word automation could be a bit more elegant, but otherwise I think it is OK.

    StuartR

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Thanks Stuart. Looks good to me. I'll give it a test.

    I had also asked about
    >Also, if I wanted to check the type of object before recording the text (I only wanted to do callouts), where do I find a list of values to test the shape against and >what property of the object do I test (looks like shpnext.AutoShapeType)?

    Any clues?

    I think I'm going to try making your strText array into a 2-dim array. For shape i, strText(i,1) will have the AnimationOrder value while strText(i,2) will have the text. Then I can sort by the animation order (not sure how to sort an array automatically in VBA). An object with no animation will get 0. From what I see, an object w/o animation does not have an AnimationOrder property. When I'm going to store the info in the strAllText string, I can concatentate "Step #" & strText(i,1) & ": "
    & strText(i,2) & vbcrlf to give me what I want.

    Thanks again.

    Fred

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Try using shpNext.Type, this can return any of

    msoAutoShape, msoCallout, msoCanvas, msoChart, msoComment, msoDiagram, msoEmbeddedOLEObject, msoFormControl, msoFreeform, msoGroup, msoLine, msoLinkedOLEObject, msoLinkedPicture, msoMedia, msoOLEControlObject, msoPicture, msoPlaceholder, msoScriptAnchor, msoShapeTypeMixed, msoTable, msoTextBox, msoTextEffect

    If the Type is msoAutoShape then you can look at shpNext.Autoshapetype, I'm not going to copy the list of AutoShapeTypes here because it is so long, search VBA help for AutoShapeType and you will find it.

    The other thing that this Macro could do with is some code that handles shpNext.Type = msoGroup and looks at the textframes on shpNext.GroupItems

    StuartR

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Hi Stuart,

    Thks for the info on the shape types and autoshape types. I probably don't have to go there for my purpose: all the animated shapes are callouts of the same type and callouts are never used in any other way; any other shape on the slide that might have text is not automated.

    Fred

  10. #10
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    For what it's worth,

    I put together a little Macro to fetch the text from any grouped objects, just in case you ever add some extra graphics to your call outs. I have always enjoyed producing recursive code, no idea why but it seems to have a certain elegance!
    <font face="Georgia">
    Function GetGroupText(shpGroup As Shape) As String
    Dim shpNext As Shape
    Dim strText As String

    If shpGroup.Type <> msoGroup Then Exit Function

    For Each shpNext In shpGroup.GroupItems
    If shpNext.TextFrame.HasText Then
    strText = strText & shpNext.TextFrame.TextRange.Text & " "
    ElseIf shpNext.Type = msoGroup Then
    strText = strText & GetGroupText(shpGroup)
    End If
    Next shpNext
    GetGroupText = strText
    End Function
    </font face=georgia>

    This can be called from the earlier Macro by adding
    <font face="Georgia">
    If shpNext.Type = msoGroup Then
    strText(i + shpNext.AnimationSettings.AnimationOrder) = GetGroupText(shpNext)
    End If
    </font face=georgia>
    at the appropriate place.

    StuartR

  11. #11
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Capture Text in Animation Order (any)

    Thanks for the extra step, Stuart. That fleshes things out nicely.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •