[2005] Re: [2005] How to get number of selcted text in MS word
Thank so much for your helping.
your coding is not match that i want. i want code in vb.net to get number of selected text in MS word.
For example,
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop
Dim wapp As Word.Application
Dim wdoc As Word.Document
wapp = GetObject(, "Word.Application")
wapp = Nothing
wdoc = wapp.ActiveDocument
wapp.Visible = True
wapp.activedocument.range.text 'if i write like this i will get all text from MS word.
but i want to get number of selected word in MS word, for example, if i select the word "boy" in MS word then i want vb.net code to returns 3 "Number of word selected". In textbox we just write textbox.selected. please help me.
Thank very much.
Re: [2005] Re: [2005] How to get number of selcted text in MS word
If you want the no. of words then
If you want the no. of characters then
vb Code:
Selection.Characters.Count