Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA for MS Word: is there a way to make a vertical selection programmatically?

Is there a possible way, in VBA for MS Word, to make a vertical selection? I mean: is it possible to simulate the behavior of the keys Shift+Alt+Selection (by mouse) in a MS Word VBA routine?

like image 488
Roberto Santos Avatar asked Nov 20 '22 02:11

Roberto Santos


1 Answers

I find this in2007 Word Developer Reference - Selection.ColumnSelectMode Property

With Selection
    .Collapse Direction:=wdCollapseStart
    .ColumnSelectMode = True
    .MoveRight Unit:=wdWord, Count:=10, Extend:=wdExtend
    .MoveDown Unit:=wdLine, Count:=20, Extend:=wdExtend
    .Copy
    .ColumnSelectMode = False
End With

Find it is working.

like image 155
Ahmed AU Avatar answered Jan 01 '23 22:01

Ahmed AU