Running a macro to the end of a file in Visual Studio

Is there any AddIn or extension for Visual Studio 2008 that will allow me to run Macro to the end of the file? I really hate holding CTRL + SHIFT + P and wait until the end of the file is reached.

+6
source share
1 answer

You can record a macro and then open the Macro IDE (Alt + F11) and put the pre-recorded macro in a loop as follows:

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 
+5
source

Source: https://habr.com/ru/post/911359/


All Articles