You can use the algorithm of the Forward button, that will walk thru on each tags. But, it will skip <script> and <style> tags! That means, a <script src=".."> will not be replaced. Its better to replace the code that does the skip, also comment out the <style> things.
For example, this will look for all <!-- --> tags and skip their content. These are the standards that used inside the <script and <style tags, to comment out the content, but the content will be interpreted by the browser, just wont show them.
vb Code:
'in Private Sub cmdForward_Click() ...
If InStr(1, LCase(Mid$(sHTMLDocument, Text1.SelStart, lSelLength)), "<!--", vbTextCompare) > 0 Then
lNewIndex = InStr(Text1.SelStart + lSelLength - 4, LCase(sHTMLDocument), "-->", vbTextCompare) + 3:
If lNewIndex < (Text1.SelStart + lSelLength - 4) Then lNewIndex = 0
GoTo ReCheck
End If
' If InStr(1, LCase(Mid$(sHTMLDocument, Text1.SelStart, lSelLength)), "<style ", vbTextCompare) > 0 Or _
' InStr(1, LCase(Mid$(sHTMLDocument, Text1.SelStart, lSelLength)), "<style>", vbTextCompare) > 0 Then
' lNewIndex = InStr(Text1.SelStart + lSelLength - 9, LCase(sHTMLDocument), "</style>", vbTextCompare) + 9: GoTo ReCheck
' End If
After this modification, you can use the algo to walk thru the tags, that there you can execute the replacement for each src (cmdAuto2) and href (cmdAuto3) properties.
You can also try to combine the algos of cmdAuto2 and cmdAuto3.