
Originally Posted by
Pwyll2
Macropod, yours doesn't work either, actually it doesn't do what is expected: if I test it on the sample document above, the macro deletes completely 3 of the 4 paragraphs, and the one that is left, keeps all its tags even those that had to be deleted. I don't understand why

It's probably because what I'd previously understood to be paragraphs (i.e. each line of your tagged expressions) aren't paragraphs at all, but are lines within a paragraph.
By the way, what do these mean?:
*\1/\2*
*\3/\4^13
With wildcards, when you enclose part of an expression in parentheses, you can refer to that part of the expression later on (in either the Find or Replace expressions), by its 'index' in the parenthetic sequence. Thus, as I have two such parenthetic expressions in "(\<)(identifiant\>)" I can refer to them as \1 and \2. The '/' is simply the '/' character you find in the closing tag and the '^13' is a paragraph break.
Although I could modify my previous macro to take account of your tags being lines within a paragraph, I've decided to take a different approach, drawing on Gerry's:
Sub DeleteTaggedLines()
Application.ScreenUpdating = False
Dim strTags As String, i As Long
strTags = "identifiant|identifiant,image|lieu," & _
"enqueteur|contexte,DonneesMorpho|DonneesSynt," & _
"type|DateMiseAJour"
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
.Replacement.Text = ""
For i = 0 To UBound(Split(strTags, ","))
.Text = "\<" & Split(Split(strTags, ",")(i), "|")(0) & "\>*\</" & Split(Split(strTags, ",")(i), "|")(1) & "\>^l"
.Execute Replace:=wdReplaceAll
.Text = "^l\<" & Split(Split(strTags, ",")(i), "|")(0) & "\>*\</" & Split(Split(strTags, ",")(i), "|")(1) & "\>"
.Execute Replace:=wdReplaceAll
Next
End With
Application.ScreenUpdating = True
End Sub
With this approach, one still uses Find/Replace, but it also works with an input list consisting of the start and end tag name pairs, each separated by a '|' and pairs separated by ','. This makes the code much simpler to maintain - you can simply add/delete tag pairs in the 'strTags' list. You'll note that there are two Find/Replace operations for each tag. That's so tags before the last line of a paragraph are handles differently to the other lines; in practice, only one of the two replacements will occur.