After I had updated my web sites, there was some comments left over from the Dynamic Web Templates. Each div with my content started with
<!-- #BeginEditable "Main" -->
and ended with
<!-- #EndEditable -->
For some reason the elements did not show up as webbots, as did most of my other comment elements.
The procedure below will go through the first 10 letters of the innerhtml and delete the "<!-- #BeginEditable "Main" -->" if it is found. It deletes it by saving only the valid html after the end of the string found.
For j = 1 To 10
If Mid(strHTML, j, 30) = "<!-- #BeginEditable " & _
"""Main""" & " -->" Then
strHTML = Mid(strHTML, j + 31, Len(strHTML))
ActiveDocument.all.tags("div"). _
Item(intElementIndex).innerHTML = strHTML
Exit For
End If
Next j
The next procedure will look at start at the end of the InnerHTML and loop towards the beginning of the document for 10 characters.
If it finds "<!-- #EndEditable -->" it will delete it. It deletes it by only saving the HTML up to the startpoint of the string found.
For j = Len(strHTML) - 22 To Len(strHTML) - 31 Step -1
If Mid(strHTML, j, 21) = "<!-- #EndEditable -->" Then
strHTML = Mid(strHTML, 1, Len(strHTML) - 23)
ActiveDocument.all.tags("div"). _
Item(intElementIndex).innerHTML = strHTML
Exit For
End If
Next j