I
info
I'm trying to write a macro that repeatedly enters a character ("-")
from the current cursor "column" (the numer shown as "Col" on the
status bar, not the screen position of the mouse) until it reaches a
specific position (eg, 80). So if I'm on Col 10, it'd draw a line of
70 dashes until it reaches column 80. (This macro is really for
VisualStudio, where I want to draw lines while commenting code, but
the VBA concept should be the same.)
So it'd be something like:
Sub _BarEqual()
Dim iCurPos As Int16
iCurPos = GET_CURRENT_CURSOR_COLUMN ' I don't know how to get
this.
Dim iDrawCount = 80 - iCurPos
For i = 1 To iDrawCount
DTE.ActiveDocument.Selection.Text = "-"
Next
End Sub
Thanks!
from the current cursor "column" (the numer shown as "Col" on the
status bar, not the screen position of the mouse) until it reaches a
specific position (eg, 80). So if I'm on Col 10, it'd draw a line of
70 dashes until it reaches column 80. (This macro is really for
VisualStudio, where I want to draw lines while commenting code, but
the VBA concept should be the same.)
So it'd be something like:
Sub _BarEqual()
Dim iCurPos As Int16
iCurPos = GET_CURRENT_CURSOR_COLUMN ' I don't know how to get
this.
Dim iDrawCount = 80 - iCurPos
For i = 1 To iDrawCount
DTE.ActiveDocument.Selection.Text = "-"
Next
End Sub
Thanks!