Question copy Selected lines to Stings

jaiprakash

Member
Joined
Nov 28, 2008
Messages
9
Programming Experience
Beginner
Dear friends,

Am working on a project where i have to copy a select lines of text in a word document(2007) and store it in a string..

VB.NET:
 Dim document As Word.Document = Globals.ThisAddIn.Application.ActiveDocument

With Dim strstore As String = document.Content.Text

am able to get the whole content.. But how to get only the selected text..

Please help..

Regards,
Jayaprakash
 
hi i got the answer..

using this we can get the selected word into a string
VB.NET:
 Dim document As Word.Document = Globals.ThisAddIn.Application.ActiveDocument

        'Let it speak!
        Dim jai As String = document.ActiveWindow.Selection.Text
 
i have created a Plug-in in ms word with a button in it.. when u click on this button.. it will copy the selected text and put it in a String..
 
Back
Top