1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
Sub Intercalaire()
Set Ici = ActiveDocument
Dim titre
Dim pageD
Dim pageP
titre = InputBox("Tapez le titre de la partie")
pageP = InputBox("Tapez le numéro de la première page de la partie")
pageD = InputBox("Tapez le numéro de la denrière page de la partie")
If Not IsNumeric(pageP) Then Exit Sub
If Not IsNumeric(pageD) Then Exit Sub
Select Case page
Case "Informations générales"
For i = pageP To pageD
Set rect = Ici.Pages(i).Shapes.AddShape(msoShapeRectangle, 543, 760, 50, 80)
With rect
.Fill.ForeColor.RGB = RGB(225, 0, 0)
.Line.ForeColor.RGB = RGB(225, 0, 0)
End With
Next i
Case "Coupe"
For i = pageP To pageD
Set rect = Ici.Pages(i).Shapes.AddShape(msoShapeRectangle, 543, 760, 50, 80)
With rect
.Fill.ForeColor.RGB = RGB(0, 225, 0)
.Line.ForeColor.RGB = RGB(0, 225, 0)
End With
Next i
End Select
End Sub |
Partager