写注释的宏,vs6.0和vs2003两个版本的

来源:互联网 发布:js对url编码 编辑:程序博客网 时间:2024/06/05 09:55

写注释的宏,vs6.0和vs2003两个版本的

一,vc6.0版本
'------------------------------------------------------------------------------
'FILE DESCRIPTION: New Macro File
'------------------------------------------------------------------------------

Sub filedescmacros()
'DESCRIPTION: A description was not provided.


'Begin Recording
 ActiveDocument.Selection = "/"
 ActiveDocument.Selection = "******************************************************************"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* Copyright (c) 2008, xxxxx有限公司"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* All rights reserved."
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 文件名称:" + ActiveDocument.Name
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 摘   要: "
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 当前版本:1.0"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 作    者:吴会然"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 完成日期:" + CStr(Date())
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 取代版本:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 原  作者:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 完成日期:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*"
 ActiveDocument.Selection = "*****************************************************************/"
 ActiveDocument.Selection.LineUp dsMove, 10
'End Recording
End Sub

Sub funcdescmacros()
'DESCRIPTION: A description was not provided.


'Begin Recording
 ActiveDocument.Selection = "/******************************************************************"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 函数介绍:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 输入参数:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 输出参数:"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "* 返回值  :"
 ActiveDocument.Selection.NewLine
 ActiveDocument.Selection = "*******************************************************************/"
 ActiveDocument.Selection.LineUp dsMove, 4
'End Recording
End Sub


二,vs2003版本

Option Strict Off
Option Explicit Off
Imports EnvDTE
Imports System.Diagnostics

Public Module RecordingModule


    Sub FileDescMacro()
        DTE.ActiveDocument.Selection.Text = "/********************************************************************"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* Copyright (c) 2008, xxxxx有限公司"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* All rights reserved."
        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 = "*"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 当前版本: 1.0"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 作    者: 吴会然"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 完成日期: " + CStr(Now().Date)
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 取代版本: "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 原  作者: "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 完成日期: "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*******************************************************************/"
        DTE.ActiveDocument.Selection.LineUp(False, 11)
        DTE.ActiveDocument.Selection.LineDown()
    End Sub
    Sub FuncDescMacro()
        DTE.ActiveDocument.Selection.Text = "/*******************************************************************"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 函数介绍:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 输入参数:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 输出参数:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* 返回值  :"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*******************************************************************、"
        DTE.ActiveDocument.Selection.DeleteLeft()
        DTE.ActiveDocument.Selection.Text = "/"
        DTE.ActiveDocument.Selection.LineUp(False, 4)
    End Sub
End Module

原创粉丝点击