
Signature
E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')
> Is there a counterpart to Alt+Shift+T which is Edit.LineTranspose? I guess
> not, right?
Isn't this "counterpart" just the same as Edit.LineTranspose applied to
the above line? I would just press ^ arrow and then Alt+Shift+T. Maybe
that's the reason why counterpart doesn't exist.
> If it doesn't exist could a macro do the same thing? If so could someone
> kindly post a macro?
Here it is:
Sub LineTransposeUp()
Dim offset As Integer
Dim sel As TextSelection
DTE.UndoContext.Open("LineTransposeUp")
Try
sel = DTE.ActiveDocument.Selection
offset = sel.ActivePoint.LineCharOffset
sel.LineUp()
DTE.ExecuteCommand("Edit.LineTranspose")
sel.LineUp()
sel.MoveToLineAndOffset(sel.ActivePoint.Line, offset)
Catch ex As System.Exception
End Try
DTE.UndoContext.Close()
End Sub

Signature
Peter Macej
Helixoft - http://www.vbdocman.com
VBdocman - Automatic generator of technical documentation for VB, VB
.NET and ASP .NET code
Robert Schneider - 26 Apr 2006 13:22 GMT
Thanks, that works fine.
One further issue: Is there any way to avoid the balloon message that comes
up from the task bar? It's saying something about the abortion of the macro.
> Isn't this "counterpart" just the same as Edit.LineTranspose applied to
> the above line? I would just press ^ arrow and then Alt+Shift+T. Maybe
> that's the reason why counterpart doesn't exist.
One line is okay. But if you want to move it several lines than it's not
that nice anymore. I know, then I could do a copy and paste. But if there is
such an shortcut it is quite more fun. At least to me.
One further optimization would be to move not just one line rather whole
blocks of code.
Actually, this is not my idea. I've used this functionality in Eclipse. I
used it quite often. Now I miss it. You know, once you get used to it...

Signature
E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')
>> Is there a counterpart to Alt+Shift+T which is Edit.LineTranspose? I
>> guess not, right?
>> If it doesn't exist could a macro do the same thing? If so could someone
>> kindly post a macro?
[quoted text clipped - 17 lines]
> DTE.UndoContext.Close()
> End Sub
Robert Schneider - 27 Apr 2006 07:07 GMT
For those that are interested to get rid of the balloon tip, look into this
blog:
http://blogs.msdn.com/johnls/archive/2006/01/17/514004.aspx
and
http://blogs.msdn.com/craigskibo/archive/2004/06/29/169190.aspx

Signature
E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')
> Thanks, that works fine.
>
[quoted text clipped - 40 lines]
>> DTE.UndoContext.Close()
>> End Sub