Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics

Public Module NewFileAndCommentMacros

    ' New File Macro
    Sub NewTextFile()
        DTE.ItemOperations.NewFile("Allgemein\Textdatei")
    End Sub

    'Comment Whole Doc Macro
    Sub CommentWholeDoc()
        Dim td As TextDocument = DTE.ActiveDocument.Object
        Dim sp As TextPoint
        Dim ep As TextPoint
        sp = td.StartPoint.CreateEditPoint()
        ep = td.EndPoint.CreateEditPoint()

        sp.Insert("/* ")
        ep.Insert(" */")

    End Sub

    'HTML Comment Macro
    Sub HTMLComment()
        Dim ts As TextSelection = DTE.ActiveDocument.Selection
        Dim ep As TextPoint
        ep = ts.BottomPoint.CreateEditPoint()
        ts.Insert("<!-- ", vsInsertFlags.vsInsertFlagsInsertAtStart)
        ep.Insert(" -->")
        ts.Collapse()
    End Sub

End Module
