VC用のコメントマクロと行削除マクロ

Sub a()
Dim startLine
startLine = ActiveDocument.Selection.TopLine
Dim endLine
endLine = ActiveDocument.Selection.BottomLine

do until startLine > endLine

ActiveDocument.Selection.GoToLine StartLine

ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.CharRight dsExtend, 2
if ActiveDocument.Selection = "//" then
ActiveDocument.Selection.CharLeft dsExtend, 2
ActiveDocument.Selection.Delete 2
else
ActiveDocument.Selection.CharLeft dsExtend, 2
ActiveDocument.Selection = "//"
end if

startLine = startLine + 1
loop
ActiveDocument.Selection.EndOfLine
End Sub



Sub b()
'DESCRIPTION: 行削除


'Begin Recording
ActiveDocument.Selection.StartOfLine dsFirstText
ActiveDocument.Selection.EndOfLine dsExtend
ActiveDocument.Selection.Delete
ActiveDocument.Selection.StartOfLine dsFirstText
ActiveDocument.Selection.EndOfLine dsExtend
ActiveDocument.Selection.Delete
ActiveDocument.Selection.Backspace
'End Recording
End Sub