row = Table1.rows.length
Set objWordDoc = CreateObject("Word.Document")
ObjWordDoc.Application.Visible=True
Dim theArray()
Redim Preserve theArray(4,row)
colnum = Table1.rows(1).cells.length
for i=0 to row-1
for j=0 to colnum-1
str=Table1.rows(i).cells(j).innerHTML
if instr(str," ") then
Table1.rows(i).cells(j).innerHTML="wwww"
end if
theArray(j+1,i+1) = Table1.rows(i).cells(j).innerHTML
next
next
Set rngPara = objWordDoc.Application.ActiveDocument.Paragraphs(1).Range
With rngPara
.Bold = True
.ParagraphFormat.Alignment = 1
.Font.Name = "Arial"
.Font.Size = 12
End With
Set rngCurrent = objWordDoc.Application.ActiveDocument.Paragraphs(3).Range
Set tabCurrent = ObjWordDoc.Application.ActiveDocument.Tables.Add(rngCurrent,intNumrows,4)
for i = 1 to colnum
ObjWordDoc.Application.ActiveDocument.Tables(1).Rows(i).Borders.Enable=true
objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.InsertAfter theArray(i,1)
objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.ParagraphFormat.alignment=1
next
tabRow = 2