Hi,
I am creating an Item Template, have it almost working except for the following problem.
I want to create a folder called "Interfaces" in my project and then add a file called Interfaces.vb to that folder, but I cannot seem to get this working.
Here is a snippet of my simple code.
Private Sub AddInterface(_dte As EnvDTE.DTE)
Dim _project As EnvDTE.Project = Nothing
For Each obj As Object In _dte.ActiveSolutionProjects
_project = TryCast(obj, EnvDTE.Project)
If _project Is Nothing Then Continue For
Next
Dim _folder As EnvDTE.ProjectItem
_folder = _project.ProjectItems.AddFolder("Interfaces")
_folder.ProjectItems.AddFromTemplate("Code\Interface", "IReportSource.vb")
End SubI keep getting null reference exceptions, because _folder.ProjectItems is null. So how do I add a file to a folder?
Gary