author: 零贰
title: VC注释宏COMMENTMAC.dsm
date: 2010-08-25 12:11:41
category: [编程代码]
tags: [VC,源码]
VC注释宏COMMENTMAC
Sub LineComment()
lTopLine = ActiveDocument.Selection.TopLine
<!--more-->
lBottomLine = ActiveDocument.Selection.BottomLine
For I = lTopLine To lBottomLine
ActiveDocument.Selection.MoveTo I,1
ActiveDocument.Selection.SelectLine
s = ActiveDocument.Selection.Text
if left(s,2) = "//" then
s = right(s,len(s)-2)
else
s = "//" + s
end if
ActiveDocument.Selection.Text = s
Next
End Sub