Hi all,
I am programming a Word Addin in C# using Netoffice. I want to get selected text or (if nothing is selected) all text.
I found that snippet:
Does anybody knows how to do that?
I am programming a Word Addin in C# using Netoffice. I want to get selected text or (if nothing is selected) all text.
I found that snippet:
string selectText = string.Empty;
Word.Selection wordSelection = this.Application.Selection;
if (wordSelection != null && wordSelection.Range != null)
{
selectText = wordSelection.Text;
}
But now I need an else which selects the whole text in the word document.Does anybody knows how to do that?