VS.Net 的Macros是一个好东西,

这几天试着写Macros感觉非常有意思,你要写文档注解,你就可以写成一个MACEOS这个快多了,
  Sub 注解()
        DTE.ActiveDocument.Selection.Text 
= "//************************** "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  名  称: "
        DTE.ActiveDocument.Selection.Text = DTE.ActiveDocument.ProjectItem().Document.Name().Substring(0, DTE.ActiveDocument.ProjectItem().Document.Name().Length - 3)
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  版  本:V1.00 "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  版    权:星际(杭州)网络有限公司"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  程序设计: WangYJ"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  开发日期:"
        DTE.ActiveDocument.Selection.Text = System.DateTime.Now.ToString()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  修 改 人:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  修改日期:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//************************* "
    End Sub

    
Sub Modify()
        DTE.ActiveDocument.Selection.Text 
= "//*************    修改  ************* "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  修改目的:"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  修 改 人:WANGYJ"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*  修改日期:"
        DTE.ActiveDocument.Selection.Text = System.DateTime.Now.ToString()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text 
= "//*********************************** "
    End Sub

不过,感觉有点不好的是,函数功能没有提示,语言就是VB的语法。
posted on 2004-08-12 18:35  edobnet  阅读(1205)  评论(5编辑  收藏  举报