i am trying to create word 2007 add-in using VS2008, and i need to know how to get the selected text inside the word document
Asked
Active
Viewed 782 times
1 Answers
2
i have found the solution:
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
public String getSelected(){
Word.Document app = add_in.Globals.ThisAddIn.Application.ActiveDocument;
String keyword = app.Application.Selection.Text;
return keyword;
}

Ahmed Abd El Atti
- 51
- 1
- 1
- 8