Get a value without making any selection.

G

Guest

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
 
G

Guest

Hi Shyam,

Thanks for your reply. The link that you provide in your reply were useful
to me only to some extent. Maybe I should state my problem clearly. What am I
trying to do rigth now is to make my addin to grab(get) value from the
Powerpoint.

When I put the cursor at a word (at any character in the word), I want the
addin to select the word and then display it in a message box. It means that
I will not make any selection(highlight the word), I just put the mouse
cursor at a certain word. So ,when I use this

TWord$ = Globals.ThisAddIn.Application.ActiveWindow.Selection.TextRange.Select
MessageBox.Show(TWord$)

Visual Studio gave an error message that the line does not produce any
value. So, how to select a word based on the location of the cursor? I had
already modifying your code but still could not make the addin to select and
retrive the word. Hope you can give me some more explanation about this.

Westman
 
G

Guest

Hi Shyam,

I have successfully make the code to work after making some modification to
it. Thank you very much for your answer and the link.

Regards,
Westman
 
G

Guest

Hi,

I've another problem regarding to my addin. Right now, the function can get
value from other part, but not the title. This occur both in the master page
and other pages as well. Based on your code, how to select word from the
"title" part? What should I used in my code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top