Hello,
I was wondering if anyone has done any add-in development with VB.NET 2008. I am writing a code generator and am having a difficult time trying to figure out how to add code to a module or class or whatever. I can add a module with this:
That returns a ProjectItem object, but I do not know how to access the text. It gives a reference to a Document object, but according to the help, a TextDocument object is required for text manipulation. But I can't find one.
If I use the macro recorder, I get code like this:
Which won't compile because I have Option Strict on. I shouldn't have to have anything late bound.
I also looked at many pages here: http://msdn.microsoft.com/en-us/library/envdte.projectitem.document%28v=VS.80%29.aspx but got no where.
I would like to add code to modules and classes along with controls and code to forms. Any one know any good sites/links or can provide me with a couple of lines of code to demonstrate this? I am having no luck.
I was wondering if anyone has done any add-in development with VB.NET 2008. I am writing a code generator and am having a difficult time trying to figure out how to add code to a module or class or whatever. I can add a module with this:
VB.NET:
DTE.ItemOperations.AddNewItem("Common Items\Code\Class", "DataAccess.vb")
That returns a ProjectItem object, but I do not know how to access the text. It gives a reference to a Document object, but according to the help, a TextDocument object is required for text manipulation. But I can't find one.
If I use the macro recorder, I get code like this:
VB.NET:
DTE.ActiveDocument.Selection.NewLine()
Which won't compile because I have Option Strict on. I shouldn't have to have anything late bound.
I also looked at many pages here: http://msdn.microsoft.com/en-us/library/envdte.projectitem.document%28v=VS.80%29.aspx but got no where.
I would like to add code to modules and classes along with controls and code to forms. Any one know any good sites/links or can provide me with a couple of lines of code to demonstrate this? I am having no luck.