Sub DocumentFileHeader()

Dim star As String
star = "//******************************************************************************"

' 将添加焦点定位在文件首部
DTE.ActiveDocument.Selection.StartOfDocument()

' 添加一个版权说明
'DTE.ActiveDocument.Selection.Text = star
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// "
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// " + DTE.ActiveDocument.Name
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// "
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// " + String.Format("Created by {0} on {1:D}.", "***", Date.Now.ToString("yy-MM-dd"))
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// " + String.Format("Copyright (c) {0}年 {1}. All rights reserved.", Date.Now.Year,"***")
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "// "
DTE.ActiveDocument.Selection.NewLine()
'DTE.ActiveDocument.Selection.Text = star
DTE.ActiveDocument.Selection.NewLine()
End Sub

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2021-11-22
  • 2021-11-24
  • 2021-09-07
  • 2021-11-27
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案