This procedure will loop through all the files in myActiveWeb.
It will try to find the div with an attribute value of "contentwide" which covers about 90% of my pages.
If it doesn't find "contentwide" it will look for "contentnarrow" which covers about 9% of of pages.
It will just close the page if neither one of them are found.
After the index value for the div is found, it will loop through each paragraph inside it.
If a paragraph has an attribute/value of class= "MsoNormal" it will change it to class="wft1".
Sub ParaClassChange()
On Error GoTo errHandler1
Dim i As Integear
Dim j As Integer
Dim intElementIndex As Integer
Dim strHTML As String
Dim eleP As IHTMLElement
For i = 0 To WebDesigner.ActiveWeb. _
AllFiles.Count - 1
If WebDesigner.ActiveWeb.AllFiles. _
Item(i).Extension = "htm" Then
WebDesigner.ActiveWeb. _
AllFiles.Item(i).Open
intElementIndex = _
GetElementIndex("div", "contentwide")
'contentwide was not found
'page probably has contentnarrow
If intElementIndex = -1 Then
intElementIndex = _
GetElementIndex("div", "contentnarrow")
End If
'either contentwide or contentnarrow was found.
If intElementIndex <> -1 Then
For j = 0 To ActiveDocument.all.tags _
("div").Item(intElementIndex).all.tags _
("p").Length - 1
Set eleP = ActiveDocument.all.tags _
("div").Item(intElementIndex).all.tags _
("p").Item(j)
If eleP.class = "MsoNormal" Then
eleP.class = "wft1"
End If
Next j
End If 'intelementindex
WebDesigner.ActivePageWindow.Save True
WebDesigner.ActivePageWindow. _
Close False, False
End If '.htm
Next i
Exit Sub
errHandler1:
MsgBox "Error " & Err.Number & " " & _
Err.Description, vbCritical, _
"AttributeValueChange has failed."
End Sub