Merci beaucoup pour ton aide !
J'ai un peu cherché sur le net suite à tes conseils et j'ai trouvé ca qui marche dans les 2 cas :
1) Décoche tous les checkbox :
1 2 3 4 5 6 7 8 9 10
| For Each shapeLoop In ActiveDocument.InlineShapes
With shapeLoop
If .Type = wdInlineShapeOLEControlObject Then
If .OLEFormat.ClassType = "Forms.CheckBox.1" Then
.OLEFormat.Object.Value = False
End If
End If
End With
Next |
2) Coche tous les checkbox :
1 2 3 4 5 6 7 8 9 10
| For Each shapeLoop In ActiveDocument.InlineShapes
With shapeLoop
If .Type = wdInlineShapeOLEControlObject Then
If .OLEFormat.ClassType = "Forms.CheckBox.1" Then
.OLEFormat.Object.Value = True
End If
End If
End With
Next |
Mais je ne comprends pas très bien la ligne :
If .OLEFormat.ClassType = "Forms.CheckBox.1" Then
Que représente le 1 dans ce code ?
Et donc questions suivantes :
Comment puis-je écrire qqch comme cela :
If CheckBox12.Value = True Then
If .OLEFormat.Object.Value = True Then
Mais comment choisir le 12 ? Ou comment indiquer une variable pour représenter le 12 ?
Comment récupérer la propriété Caption du CheckBox12 ?
Désolé pour toutes ces questions mais merci encore !
Partager