글
Technical Article/펌 2005. 4. 4. 13:43VS6 주석 달기 매크로
1. Tools->Macro-> MacroName에 Comment넣고 Edit~
밑에꺼 다 추가!
'------------------------------------------------------------------------------
'FILE DESCRIPTION: New Macro File
'------------------------------------------------------------------------------
Sub Comment()
'DESCRIPTION: A description was not provided.
Dim win
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
if InStr( ActiveDocument.Selection, vbCr ) > 0 then
ActiveDocument.Selection.ReplaceText "^", "//", dsMatchRegExp
Else
'ActiveDocument.Selection = "/* " + ActiveDocument.Selection + " */"
ActiveDocument.Selection = "//" + ActiveDocument.Selection
End If
End If
End Sub
Sub UnComment()
'DESCRIPTION: 주석 해제
Dim win
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
ActiveDocument.Selection.ReplaceText "^//", "", dsMatchRegExp
End If
End Sub
2. Options->KeyStrokes 에 다음 할당~
주석 : CTRL+/
주석해제 : CTRL+SHIFT+/
셋팅완료!
밑에꺼 다 추가!
'------------------------------------------------------------------------------
'FILE DESCRIPTION: New Macro File
'------------------------------------------------------------------------------
Sub Comment()
'DESCRIPTION: A description was not provided.
Dim win
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
if InStr( ActiveDocument.Selection, vbCr ) > 0 then
ActiveDocument.Selection.ReplaceText "^", "//", dsMatchRegExp
Else
'ActiveDocument.Selection = "/* " + ActiveDocument.Selection + " */"
ActiveDocument.Selection = "//" + ActiveDocument.Selection
End If
End If
End Sub
Sub UnComment()
'DESCRIPTION: 주석 해제
Dim win
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
ActiveDocument.Selection.ReplaceText "^//", "", dsMatchRegExp
End If
End Sub
2. Options->KeyStrokes 에 다음 할당~
주석 : CTRL+/
주석해제 : CTRL+SHIFT+/
셋팅완료!
![](https://lh3.googleusercontent.com/-hYZb_novCPQ/V5HuGPkGFUI/AAAAAAAAANk/f8zcKkeTBbA1A-W6yuqfk12fs8bd8FeOQCL0B/banner_468_60.png)
RECENT COMMENT