X
xiaohai wang via OfficeKB.com
hello,
i'm a newer in VB.
could any boddy tell me how can i convert an exising word file to a HTML
file,using VB.
Attention please, not only SaveAs to HTML simply.
now i can covert a .doc file to HTML file when it contain characters
entirely. the following code cloud do it(portion).
But i can't convert the .doc file to HTML when it contain table.
if somebody can help me,thank you very much!
*******************************************************************
(portion)
Dim objWordApp As New Word.Application
Dim objDoc As Word.Document
Set objWordApp = CreateObject("Word.Application")
Set objDoc = objWordApp.Documents.Open("mydoc3.doc", , , , , , False)
Dim objP As word.Paragraphs
Set objP = objDoc.Paragraphs
Dim intCnt As Integer
Dim strPr As String
For intCnt = 1 To objP.Count
strPr = objP.Item(intCnt).Range.Text
Open "tel.html" For Append As #1
head$ = "<html><head><title>hello</title></head><body><center>"
theTable$ = "<table border=0 width=70%><tr bgcolor= >"
items$ = "<td align=left> "& strPr & "</td>"
items2$ = "</tr>"
theEnd$ = "</table></center></body></html>"
Print #1, head$, theTable$, items$, items2$, theEnd$
Close #1
Next inCnt
*************************************************************
i'm a newer in VB.
could any boddy tell me how can i convert an exising word file to a HTML
file,using VB.
Attention please, not only SaveAs to HTML simply.
now i can covert a .doc file to HTML file when it contain characters
entirely. the following code cloud do it(portion).
But i can't convert the .doc file to HTML when it contain table.
if somebody can help me,thank you very much!
*******************************************************************
(portion)
Dim objWordApp As New Word.Application
Dim objDoc As Word.Document
Set objWordApp = CreateObject("Word.Application")
Set objDoc = objWordApp.Documents.Open("mydoc3.doc", , , , , , False)
Dim objP As word.Paragraphs
Set objP = objDoc.Paragraphs
Dim intCnt As Integer
Dim strPr As String
For intCnt = 1 To objP.Count
strPr = objP.Item(intCnt).Range.Text
Open "tel.html" For Append As #1
head$ = "<html><head><title>hello</title></head><body><center>"
theTable$ = "<table border=0 width=70%><tr bgcolor= >"
items$ = "<td align=left> "& strPr & "</td>"
items2$ = "</tr>"
theEnd$ = "</table></center></body></html>"
Print #1, head$, theTable$, items$, items2$, theEnd$
Close #1
Next inCnt
*************************************************************