I am trying to write some VBA code to remove all the attributes from the TABLE element, so far I have got:
this will run ok, i.e. no syntax errors, etc. But, the booResult is always False and the attribute is still there!
I did write this once a few weeks ago, but someone deleted it and I now trying to remember how I did it.
Anyone got any other ideas? Please no java script.
ITLee. MCP\Dev\Prog\DBA\ITIL
Code:
Function RemoveFormattingFromTable()
Dim fpPage As FPHTMLDocument
Dim fpTable As FPHTMLTable
Dim i As Integer
Dim booResult As Boolean
Set fpPage = ActiveDocument
For i = 0 To fpPage.all.tags("table").Length - 1
Set fpTable = fpPage.all.tags("table")(i)
booResult = fpTable.removeAttribute("ACCESSKEY")
booResult = fpTable.removeAttribute("ALIGN")
booResult = fpTable.removeAttribute("BACKGROUND")
booResult = fpTable.removeAttribute("BGCOLOR")
booResult = fpTable.removeAttribute("BORDER")
booResult = fpTable.removeAttribute("BORDERCOLOR")
booResult = fpTable.removeAttribute("CELLPADDING")
booResult = fpTable.removeAttribute("CELLSPACING")
booResult = fpTable.removeAttribute("CLASS")
booResult = fpTable.removeAttribute("COLS")
booResult = fpTable.removeAttribute("DATAPAGESIZE")
booResult = fpTable.removeAttribute("DATASRC")
booResult = fpTable.removeAttribute("DIR")
booResult = fpTable.removeAttribute("FRAME")
booResult = fpTable.removeAttribute("HEIGHT")
booResult = fpTable.removeAttribute("ID")
booResult = fpTable.removeAttribute("LANG")
booResult = fpTable.removeAttribute("LANGUAGE")
booResult = fpTable.removeAttribute("RULES")
booResult = fpTable.removeAttribute("STYLE")
booResult = fpTable.removeAttribute("TABINDEX")
booResult = fpTable.removeAttribute("TITLE")
booResult = fpTable.removeAttribute("WIDTH")
Next i
Set fpTable = Nothing
Set fpPage = Nothing
End Function
this will run ok, i.e. no syntax errors, etc. But, the booResult is always False and the attribute is still there!
I did write this once a few weeks ago, but someone deleted it and I now trying to remember how I did it.
Anyone got any other ideas? Please no java script.
ITLee. MCP\Dev\Prog\DBA\ITIL