Public Module Commend
Sub HeadFileCommend()
Dim defineName = CStr(ActiveDocument.Name).Replace(".", "_").ToUpper() + "_"
DTE.ActiveDocument.Selection.StartOfDocument()
DTE.ActiveDocument.Selection.Text = "//"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// " + ActiveDocument.Name
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// "
For i = 1 To ActiveDocument.Name.Length
DTE.ActiveDocument.Selection.Text = "~"
Next
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "//"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// @Author xxxx
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "//"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// @Copyright 2011-2015"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "//"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "#ifndef " + defineName
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "#define " + defineName
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.EndOfDocument()
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "#endif // " + defineName
DTE.ActiveDocument.Selection.NewLine()
End Sub
End Module