首页 > 开发技术 > 写注释的宏,vs6.0和vs2003两个版本的

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

2010年3月14日 发表评论 阅读评论

以前发表在CSDN Blog中的,今天用到转发此地。

http://blog.csdn.net/wuhuiran/archive/2008/05/10/2427419.aspx

 

一,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

分类: 开发技术 标签: , 740 views
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.