在VS2005 中增加类说明和修改说明的宏代码, 每次自己添加都搞的很麻烦, 从网上搜罗了下,
重新整理了下格式自己就用上了
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module LiteComment
Sub ClassComment()
Dim doc As Document = DTE.ActiveDocument
Dim docText As TextDocument = doc.Object
Dim selText As TextSelection = docText.Selection()
Dim strText As String
strText = "/" + vbCrLf
strText += "// 功能描述: " + vbCrLf
strText += "// 编 写 人: " + vbCrLf
strText += "// 编写日期: " + System.DateTime.Now.ToString("yyyy-MM-dd HH:00:00") + vbCrLf
strText += "// 修 改: " + vbCrLf
strText += "// 修 改 人: " + vbCrLf
strText += "// 修改日期: " + vbCrLf
strText += "// 备 注: " + vbCrLf
strText += "/" + vbCrLf
selText.Insert(strText)
End Sub
Sub EditComment()
Dim doc As Document = DTE.ActiveDocument
Dim docText As TextDocument = doc.Object
Dim selText As TextSelection = docText.Selection()
Dim strText As String
strText = "/" + vbCrLf
strText += "// 修改说明: " + vbCrLf
strText += "// 修 改 人: " + vbCrLf
strText += "// 修改日期: " + vbCrLf
strText += "// 备 注: " + vbCrLf
strText += "/" + vbCrLf
selText.Insert(strText)
End Sub
End Module