Results 1 to 19 of 19

Thread: PowerPoint - Selected Action Item

  1. #1

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    PowerPoint - Selected Action Item

    If I have 'Action Settings' assigned to 3 words in a Power Point Slide,
    how can I return the 'selected' (mouse down) word, that is an Action item, within that slide.

    ie If the one of the Action items is the word "visual", and I select it with the mouse (it envokes the Action - a Macro), that I can pass the word "visual" to the Macro (Module Sub).

    I have tried many methods. It appears 'Hyperlinks' have thier oun collection, but not 'Action Settings'.




    Cheers,
    Bruce.
    Last edited by Bruce Fox; Aug 27th, 2003 at 04:05 PM.

  2. #2

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

  3. #3

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Ideas

  4. #4
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    you could place the hyperlink in a textbox

    and you the text box events
    Just an idea

  5. #5

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Thanks for the reply adocwra,

    Unfortunatly that isn't an option as there are too many slides, and I want to apply this proccess to other peoples .ppts.

    I have played around with a few API's to return the text under the mouse,
    but it seem to have to be 'selected' text.

    In short, I need some way of returning the 'word' (thats been setup as an Action Item) to be returned.


    PPT must know what Action Item (word) that was selected, as it can run the Macro or whatever Action has been set - I need to tap into that.
    Maybe subclassing, but I think that would be too hazardous as these
    PPTs will be given over a LAN.



    Bruce.

  6. #6
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    i know this code shows all actions as link in a presentation maybe you could play around with this
    Code:
    Dim a As Slide
    Set a = ActivePresentation.Slides(1)
    
    For i = 1 To a.Hyperlinks.Count - 1
    Debug.Print a.Hyperlinks(i).TextToDisplay
    Next

  7. #7
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    i know this code shows all actions as link in a presentation maybe you could play around with this
    Code:
    Dim a As Slide
    Set a = ActivePresentation.Slides(1)
    
    For i = 1 To a.Hyperlinks.Count - 1
    Debug.Print a.Hyperlinks(i).TextToDisplay
    Next
    and in the object browser you can get all the classes and properties

  8. #8
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    i assigned macro1 to the action to run on mouse click
    macro1 has
    Code:
     
    a = ActiveWindow.Selection.TextRange  
     Debug.Print a 
    'and i think this is what you need
    
    'then i recorded the assigning of the acrion and it gave me this
    
    With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseOver)
            .Run = "Macro1"
            .Action = ppActionRunMacro
            .SoundEffect.Type = ppSoundNone
            .AnimateAction = msoFalse
        End With
    i know this is bad programming but i dont know powerpoint as well as i do everythinng else

  9. #9

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Thanks again, I had unsuccessfully tried similar approaches

    But, I'm still trying.....

    Cheers,
    Bruce.

  10. #10
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    sub mac
    a = ActiveWindow.Selection.TextRange
    Debug.Print a
    'and i think this is what you need

    if a="visual" then dosomethingelse
    end sub

    would work I think

    the example of


    With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseOver)
    .Run = "Macro1"
    .Action = ppActionRunMacro
    .SoundEffect.Type = ppSoundNone
    .AnimateAction = msoFalse
    End With

    was to show how to programatically assign the macro to the action

  11. #11

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Originally posted by adocwra
    was to show how to programatically assign the macro to the action
    Yep, I was aware of that


    Unfortunatly, I think .TextRange returns ALL the text (in the shape), not just the Action Item.

    It kinda sucks, I didn't think it would be this hard PPT must know what item was selected so it can take action.


    Hmmmm.


    Bruce.

  12. #12

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Bugger!

    I have just been messing with the PPT MS Design Environment, that displays the Script behid the presentation.

    Each Action has a unique call to the Macro. In short, I don't think I can do what I wanted... - well see

  13. #13
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    I guess I am fasinated with this

    you could make a macro for each action


  14. #14
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    I take it you can't assign different actions

    thus:

    Word1 >> MyFunc(Foo)
    Word2 >> MyFunc(Bar)

  15. #15

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    adocwra & Matt,

    Your right, I could make a Macro for each word.... but that wouldn't work for my situation.


    Scenario
    What I'm attempting to do is to have a global Glossary of Terms (GoT), that exist for use by many Instructors. So, during a PPT pressentation,
    a instructor could click (on a pre determind word) and they would be pressented
    with a MsgBox containing the 'words' definition.

    The reaon for this approach, is that I can get each instructor (10+) to simply set 'thier' word to an Action Setting, for the GoT Macro, and vola! Each ingividual needs no programming skills to do this. I will code up the Maco (Module) and apply it thru our 'Template' (of course I will add the 'word' definitions as required).

    Plan
    I have the GoT (list) saved as an .ini file, and I'm using the Ini API to return the relavent definition.

    Problem
    To make this work, I need to be able to pass the selected (Action Set) 'word' to the API to return the appropriate definition.

    (I don't want to use the 'Screen Tip' as an alternate)


    Hope that makes sense.


    Thanks again for your input



    Bruce.
    Last edited by Bruce Fox; Sep 2nd, 2003 at 05:12 PM.

  16. #16

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    * See above post *

  17. #17
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    sounds like assigning a macro to each link would be nearly impossible

    good luck fiding the solution I'm out of ideas but will keep thinking about it

  18. #18

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Cheers - Watch this space.....




    Bruce.

  19. #19
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    cant wait to see you figure it out


    you can figure out what rectangle you are in but because you cant select an action you never have selected text
    Bummer

    Anna

Posting Permissions

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



Click Here to Expand Forum to Full Width