I've already used the DTE object and have coded the following lines into a
button click event:
' Get an instance of the currently running Visual Studio .NET IDE.
Dim dte As New EnvDTE.DTE
dte =
System.Runtime. InteropServices .Marshal.GetAct iveObject("Visu alStudio.DTE")
'Get selected text
Dim objSel As TextSelection = dte.ActiveDocum ent.Selection
lblTest.Text = objSel.Text
however, i am getting the following error:
Exception Details: System.Runtime. InteropServices .COMException: COM object
with CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} is either not valid or not
registered.
on the following line of code:
Dim dte As New EnvDTE.DTE
I hope that you can help me.
Thanx.
"Eliyahu Goldin" wrote:
It's a client side function. Look at DHTML document.select ion object. You
can get the selected text on the client and communicate it to the server in
a hidden text input.
Eliyahu
"Hassan Bassam" <Hassan Ba****@discussi ons.microsoft.c om> wrote in message
news:3F******** *************** ***********@mic rosoft.com... I am having a problem. How can I get the selected text from a text editor.
I am using ASP.NET and VB as language.
Thanx