Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Public Module Module1 Dim strUser = "// My Name " Dim strDate = "10-Augest-2010 " Dim strCQID = "44553 : " Dim strCQHeadline = "Crash when click ok button ..." Dim strComment = strUser & strDate & strCQID & strCQHeadline Sub BeginComment() 'DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocument.Selection.Text = strComment & "[Begin]" End Sub Sub EndComment() 'DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocument.Selection.Text = strComment & "[End]" End Sub Sub BeginEndComment() DTE.ActiveDocument.Selection.Text = strComment & "[Begin]" DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocument.Selection.Text = strComment & "[End]" End Sub End Module