宏的功能是将选中行的开头加“#”,如果选中的行已经以“#”开头,则去除。
Sub zhushi()
'DESCRIPTION: 给perl添加注视
Dim Sel
Dim str
Set Sel=ActiveDocument.Selection
str = Mid(Sel.text,1,1)
if str = "#" then
Sel.ReplaceText "^#","",dsMatchRegExp
else
Sel.ReplaceText "^","#",dsMatchRegExp
end if
'End Recording
End Sub
阅读(1279) | 评论(0) | 转发(1) |