none
Get value without making a selection RRS feed

  • Question

  • Hello all,

    I've created an addin for Powerpoint 2007 using VSTO2005 SE. My addin have a function that can get value from Powerpoint. For example, it will get the value from the selection that have been made in Powerpoint and display it in a message box.

    TWord$ = Globals.ThisAddIn.Application.ActiveWindow.Selection.TextRange.Text

    MessageBox.Show(TWord$)

    The above example code is working only if I have made a selection (highlight any word in any slide). My problem is, can I make the function to get value from Powerpoint just by placing the cursor at any one word? Is this possible? Can somebody explain how to make this work?

    Thank you.

    Westman

    Wednesday, February 28, 2007 4:25 AM

Answers

  • Hi Westman

    The best place to get help on working with an application is the newsgroup for that application or the office.developer.automation newsgroup. You'll find links to useful newsgroups, where application specialists congregate, in the Please Read First message at the top of this forum. Even though you'll find some object model discussions in this forum, it is mainly targeted at the VSTO technology. Since Powerpoint add-ins are new to VSTO, there aren't many people who come by this forum who know that object model.

    I can tell you that, as long as you can identify in some way what you want to query, you can read things from Powerpoint slides without needing to make any selection. The boxes on the slide belong to the SHAPES collection (I think) that can be enumerated using an integer index or a name. Powerpoint assigns a default name when the Shape is created, but using the object model you can also assign names. Very roughly, then, your code would be:

      Application.Slides(index).Shapes(index).TextFrame.TextRange.Text

    But do ask in the powerpoint newsgroup :-)

    Wednesday, February 28, 2007 4:44 PM
    Moderator

All replies

  • Hi Westman

    The best place to get help on working with an application is the newsgroup for that application or the office.developer.automation newsgroup. You'll find links to useful newsgroups, where application specialists congregate, in the Please Read First message at the top of this forum. Even though you'll find some object model discussions in this forum, it is mainly targeted at the VSTO technology. Since Powerpoint add-ins are new to VSTO, there aren't many people who come by this forum who know that object model.

    I can tell you that, as long as you can identify in some way what you want to query, you can read things from Powerpoint slides without needing to make any selection. The boxes on the slide belong to the SHAPES collection (I think) that can be enumerated using an integer index or a name. Powerpoint assigns a default name when the Shape is created, but using the object model you can also assign names. Very roughly, then, your code would be:

      Application.Slides(index).Shapes(index).TextFrame.TextRange.Text

    But do ask in the powerpoint newsgroup :-)

    Wednesday, February 28, 2007 4:44 PM
    Moderator
  • Hi Cindy,

    Thanks for the reply. I'm kinda new to this forum, so maybe I have misread/misunderstood the rules. Your infomation are very helpful. And perhaps this question is out of the topic, but I just want to know something.  Is there any Powerpoint MVP in this forum? When will the VSTO forum to start include  Powerpoint-related-question more ?

    By the way, I have already solve the problem that I state in my previous post after posting it the right forum. And thanks again for the information.

     

    Regards,

    Westman

    Friday, March 2, 2007 10:00 AM