文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>VC注释宏

VC注释宏

时间:2011-01-04  来源:wyangwo

    其中包括全屏编辑、文件注释、类注释、函数注释四个宏。为了写程序更加方便,可以为这几个常用的宏添加快捷键。

Sub FullScreen()
'DESCRIPTION: 全屏编辑
    ExecuteCommand "ToggleFullScreen"
End Sub

Sub AddHeadDesc()
'DESCRIPTION: 添加一个标准的头文件说明
    ActiveDocument.Selection.StartOfDocument
    DefaultUserName = "mubai"
    Dim FileName
    FileName = ActiveDocument.Name
    ActiveDocument.Selection = "/*******************************************************************" +_
                        vbLF + " 文件名        :" + FileName +_
                        vbLF + " 创建者        :" + DefaultUserName +_
                        vbLF + " 创建时间    :" + CStr(Now) +_
                        vbLF + " 功能描述    :" +_
                        vbLF + "              " +_
                        vbLF + " ******************************************************************/" +_
                        vbLF
    ActiveDocument.Selection.LineUp flase, 3
    ActiveDocument.Selection.EndOfLine
End Sub

Sub AddClassDesc()
'DESCRIPTION: 添加类注释
    Dim ClassName
    ClassName = ActiveDocument.Selection.Text
    ActiveDocument.Selection.StartOfLine
    ActiveDocument.Selection = "/******************************************************************" +_
                        vbLF + " 类名        :" + ClassName +_
                        vbLF + " 创建时间    :" + CStr(Now) +_
                        vbLF + " 功能描述    :" +_
                        vbLF + "              " +_
                        vbLF + " ******************************************************************/" +_
                        vbLF
    ActiveDocument.Selection.LineUp flase, 3
    ActiveDocument.Selection.EndOfLine
End Sub

Sub AddMethodDesc()
'DESCRIPTION: 添加函数注释
    Dim MethodName
    MethodName = ActiveDocument.Selection.Text
    ActiveDocument.Selection.StartOfLine
    ActiveDocument.Selection = "/******************************************************************" +_
                        vbLF + " 函数名        :" + MethodName +_
                        vbLF + " 参数        :" +_
                        vbLF + " 返回值        :" +_
                        vbLF + " 功能描述    :" +_
                        vbLF + "              " +_
                        vbLF + " ******************************************************************/" +_
                        vbLF
    ActiveDocument.Selection.LineUp flase, 5
    ActiveDocument.Selection.EndOfLine
End Sub

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载