locked
how to access the dialog data and to place text in VS IDE editor in VB script file.. RRS feed

  • Question

  • Hi 

    Could any expert here help me!

    I am using VSIX package to have a WPF tree control located inside a Tool window. On selecting particular item in tool window tree control a dialog window appears to user and once user selects OK on dialog

    "i want to access data entity(class representation) of that dialog object and based on those values i need to place some text in VS IDE editor" Could anyone shed some light how to access the dialog data and to place text in VS IDE editor.


    • Edited by Kgopalun Monday, March 12, 2012 5:59 PM
    Monday, March 12, 2012 5:33 AM

Answers

  • Hi Kgopalun,
    What do you mean the “ VS IDE Editor”, if you refer to the general editor, like CSharp Editor, C++ Source Code Editor and so on.
    You can try to use the EditPoint Interface to place text to the editor .
    For example, you can use the following code to insert the “hello” to your editor.
    Sub EditPointExample()
      ' Before running this example, open a text document.
      Dim objTD As TextDocument
      Dim objEP As EditPoint

      objTD = DTE.ActiveDocument.Object("TextDocument")
      objEP = objTD.StartPoint.CreateEditPoint
      objEP.Insert "Hello"
    End Sub
    More information, please refer to : http://msdn.microsoft.com/en-us/library/envdte.editpoint.aspx


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by lucy-liu Wednesday, March 14, 2012 8:38 AM
    • Marked as answer by lucy-liu Monday, March 19, 2012 7:42 AM
    Wednesday, March 14, 2012 2:46 AM

All replies

  • Hi Kgopalun,
    What do you mean the “ VS IDE Editor”, if you refer to the general editor, like CSharp Editor, C++ Source Code Editor and so on.
    You can try to use the EditPoint Interface to place text to the editor .
    For example, you can use the following code to insert the “hello” to your editor.
    Sub EditPointExample()
      ' Before running this example, open a text document.
      Dim objTD As TextDocument
      Dim objEP As EditPoint

      objTD = DTE.ActiveDocument.Object("TextDocument")
      objEP = objTD.StartPoint.CreateEditPoint
      objEP.Insert "Hello"
    End Sub
    More information, please refer to : http://msdn.microsoft.com/en-us/library/envdte.editpoint.aspx


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by lucy-liu Wednesday, March 14, 2012 8:38 AM
    • Marked as answer by lucy-liu Monday, March 19, 2012 7:42 AM
    Wednesday, March 14, 2012 2:46 AM
  • Hi Lucy,

    Where can we write this code. can we write this code in a VSIX package or inside user control.
    because i am using VSIX which references to an user control.

    Thanks
    Kiran

    Wednesday, March 14, 2012 5:35 PM
  • Kgopalun, you can try to write this code to your VSIX package
    Friday, March 16, 2012 6:40 AM
  • Hi Kgopalun,

    I temporary make my last reply as answer. You can unmark it if they provide no help.

    Thank you for your understanding!


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 19, 2012 7:42 AM
  • Hi Lucy,

    Can u explain where exactly w need to write this code in VSIX package. I could not see any possibility writing this snippet in VSIX.

    from VSIX package i am generating a tool window. I need to make changes to Text/code script in current opened document in IDE

    (bacically a VB.net script editor file ).

    Thanks,
    Kgopalun

    Wednesday, March 21, 2012 9:08 AM