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
| Private Sub ListField()
Dim o As Object
Dim s As Shape
Dim f As Field
On Error GoTo Err_ListField
For Each f In ActiveDocument.Fields
Debug.Print Replace(Replace(f.Code, Chr(21), "}"), Chr(19), "{")
Next f
For Each s In ActiveDocument.Shapes
Debug.Print s.Name, s.Top, s.left
Debug.Print s.RelativeVerticalPosition, s.RelativeHorizontalPosition 'Essai pour voir ce que cela renvoi
Debug.Print s.TextFrame.TextRange.Fields.Count
For Each f In s.TextFrame.TextRange.Fields
Debug.Print Replace(Replace(f.Code, Chr(21), "}"), Chr(19), "{")
Next f
NextShape:
Next s
Exit_ListField:
Exit Sub
Err_ListField:
Select Case Err.Number
Case 5917
Resume NextShape
Case Else
MsgBox "Erreur : " & Err.Number & ", " & Err.Description
End Select
End Sub |
Partager