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.GetActiveObject("VisualStudio.DTE")
'Get selected text
Dim objSel As TextSelection = dte.ActiveDocument.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.