Programmation vb
' Option Explicit
Sub Liste_les_commandes()
Application.ListCommands ListAllCommands:=True
End Sub
Sub sel0()
'Dim sel As Selection
'Set sel = Application.Selection
'MsgBox sel
'MsgBox Application.Selection
MsgBox Selection
End Sub
Sub sel1()
Dim i
Dim sel As Selection
Set sel = Application.Selection
MsgBox sel
For i = 1 To 4 sel.MoveRight unit:=wdCharacter, Count:=1
MsgBox sel
'sel.MoveRight unit:=wdWord, Count:=1
'sel.MoveRight unit:=wdSentence, Count:=1, Extend:=wdExtend
'sel.Moveright unit:=wdParagraph, Count:=1
'sel.Moveright unit:=wdLine, Count:=1
'sel.MoveRight unit:=wdStory, Count:=1
'sel.MoveRight unit:=wdCharacter, Count:=1
'sel.MoveRight unit:=wdWord, Count:=1
'sel.MoveLeft unit:=wdWord, Count:=1, Extend:=wdExtend
'sel.Moveright unit:=wdParagraph, Count:=1
'sel.Moveright unit:=wdLine, Count:=1
'sel.MoveRight unit:=wdStory, Count:=1
MsgBox i
Next
Selection.HomeKey unit:=wdLine Selection.MoveRight unit:=wdWord, Count:=3 Selection.EndKey unit:=wdLine Selection.MoveLeft unit:=wdWord, Count:=2 Selection.MoveUp unit:=wdLine, Count:=1 Selection.MoveDown unit:=wdLine, Count:=1
End Sub
Sub sel2()
Dim sel As Selection
Set sel = Application.Selection sel.MoveLeft unit:=wdStory, Count:=1
End Sub
Sub plage0()
Dim plage As Range
Set plage = ActiveDocument.Range(Start:=10, End:=110) plage.Select End Sub
Sub plage1()
Dim plage As Range
Set plage = ActiveDocument.Range(Start:=0, End:=ActiveDocument.Characters.Count) plage.Select End Sub
Sub plage2()
Dim plage As Range
Set plage = ActiveDocument.Range plage.WholeStory plage.Select
End Sub
Sub plage3()
MsgBox ActiveDocument.Characters(ActiveDocument.Characters.Count)
MsgBox ActiveDocument.Characters(ActiveDocument.Characters.Count - 1)
End Sub
Sub plage4()
Dim plage As Range
Set plage = ActiveDocument.Range plage.Expand unit:=wdStory
End Sub
Sub plage5()
Dim plage As Range