This macro is written by Stephen Travis, MVP for Frontpage.
__________________________________________
Sub spooky_Diet()
Dim innerHTML As String, Webbot As String
If Not FrontPage.ActiveDocument Is Nothing Then
If FrontPage.ActivePageWindow.ViewMode = fpPageViewNormal Then
innerHTML = ActiveDocument.body.innerHTML
Do
Webbot = Ellipse(innerHTML, "<!--webbot" , "-->" )
If Webbot = "" Then Exit Do
If InStr(Webbot, "bot=""" ) <> 0 Then
innerHTML = Replace(innerHTML, Webbot, "" )
End If
Loop
ActiveDocument.body.innerHTML = innerHTML
End If
End If
End Sub
Function Ellipse(i, s, e)
Dim f As Integer, t As Integer
Ellipse = ""
f = InStr(1, i, s, 1)
If f > 0 Then
t = InStr(f + 1, i, e, 1)
If t > 0 Then
Ellipse = Mid(i, f, t - f) & e
End If
End If
End Function
Updated to remove all web bot information.
Prevents crashing when using against list boxes.
Note - all webbot information is removed, so if you have bots other than database in the page, they will also be removed.
The other alternative is to specify all of the possible options that you want to include or exclde with this code :
If InStr(Webbot, "bot=""Database" ) <> 0 Then
innerHTML = Replace(innerHTML, Webbot, "" )
End If
If InStr(Webbot, " bot=""SaveAsASP" ) <> 0 Then
innerHTML = Replace(innerHTML, Webbot, "" )
End If
etc...