有VS2005想做一个自动插入时间的宏,但是不知道VS2005有没有插入日期时间的快捷键,所以只得写了这么一个宏
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub Macro1()
Dim doc As Document = DTE.ActiveDocument
Dim docText As TextDocument = doc.Object
Dim selText As TextSelection = docText.Selection()
selText.StartOfDocument(False)
Dim str As String = " /****************************** " + vbCrLf & "* 取得数据库中关于数据表的信息" + vbCrLf + "* 作者:蔡兴钰" + vbCrLf + "* 日期:" + System.DateTime.Now.ToString() + vbCrLf + "******************************/ "
selText.Insert(str)
End Sub
End Module
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub Macro1()
Dim doc As Document = DTE.ActiveDocument
Dim docText As TextDocument = doc.Object
Dim selText As TextSelection = docText.Selection()
selText.StartOfDocument(False)
Dim str As String = " /****************************** " + vbCrLf & "* 取得数据库中关于数据表的信息" + vbCrLf + "* 作者:蔡兴钰" + vbCrLf + "* 日期:" + System.DateTime.Now.ToString() + vbCrLf + "******************************/ "
selText.Insert(str)
End Sub
End Module