VC++6中自定义单元头注释模板
用了一段时间VC6,发现里面有一些在Delphi中很常见的功能都没有,所以尝试着自己解决这个问题。
今天主要是解决文件头的注释问题,在网上看了一些博文,然后整理出了一个适合自己的模板,现记录如下:
Sub FileComment()
'DESCRIPTION: 文件头的注释
ActiveDocument.Selection = "/*--------------------------------------------------------------------"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = Space(2) + "Name: " + ActiveDocument.Name
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "Copyright: " + "华科"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "Author: " + "华科"
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "Date: "
ActiveDocument.Selection = DATE + TIME
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "Description: "
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "Modification: "
ActiveDocument.Selection.NewLine
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = Space(0) + "--------------------------------------------------------------------*/"
End Sub
熟悉VB语法的人一看就明白上面是怎么回事了。