Visual Studio 2008 是否有一些加载项或扩展允许我运行宏直到文件结束?我真的很讨厌按住 CTRL+SHIFT+P 并等到文件末尾。
最佳答案
您可以录制一个宏,然后打开宏 IDE (Alt + F11) 并将预先录制的宏放入一个循环中,如下所示:
Sub TemporaryMacro()
selection = DTE.ActiveDocument.Selection()
anchorPoint = selection.AnchorPoint.CreateEditPoint
selection.EndOfDocument(True)
endPoint = selection.BottomPoint.CreateEditPoint()
selection.MoveToPoint(anchorPoint)
Do While True
isEOF = DTE.ActiveDocument.Selection.TopPoint.CreateEditPoint().Line = endPoint.Line
If (isEOF) Then
Exit Do
End If
' Prerecorded macro
DTE.ActiveDocument.Selection.Text = " "
DTE.ActiveDocument.Selection.LineDown()
DTE.ActiveDocument.Selection.CharLeft()
' End of prerecorder macro
Loop
End Sub
关于c# - 在 Visual Studio 中运行宏直到文件末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9813188/