Open fspafford opened 8 years ago
I think these script functions does what you want:
dte.ActiveDocument.Selection.WordRight(true); // selects the next word (ctrl+shift+right)
dte.ActiveDocument.Selection.Cut(); // cuts selected text (ctrl+x)
dte.ActiveDocument.Selection.Copy(); // copies selected text (ctrl+c)
dte.ActiveDocument.Selection.Paste(); // pastes selected text (ctrl+v)
I suggest you record a macro doing what you want and read the source by right clicking on the 'current' macro and choose 'Open'. I found that a great way of learning the scripting functions.
ex: change static public string test;
to public static string test;
dte.ActiveDocument.Selection.WordRight(true); // select "static "
dte.ActiveDocument.Selection.Cut(); // cut "static "
dte.ActiveDocument.Selection.WordRight(); // skip "public "
dte.ActiveDocument.Selection.Paste(); // paste "static "
I would like the ability to place text on the clipboard, and to read text from the clipboard.
I have used the clipboard in VB macros, and have found the feature very handy.
Thanks