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
|
Sub AutoOpen()
' AutoOpen Macro
' Macro created 05/10/2008 by acer
Dim aStory As Range
Dim aField As Field
Dim tableau(1000) As String
Dim i As Integer
Dim majOK As Boolean
Dim cptTableau As Integer
cptTableau = 0
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
majOK = True
For i = 0 To cptTableau
If UCase(tableau(i)) = UCase(aField.Code.Text) Then
majOK = False
End If
Next i
If majOK = True Then
aField.Update
If InStr(aField.Code.Text, "ASK") <> 0 Then
tableau(cptTableau) = aField.Code.Text
cptTableau = cptTableau + 1
End If
End If
Next aField
Next aStory
End Sub |
Partager