Though I have found many websites to do the conversion online very well, but I have to do it one by one, it's annoying. So is there any tools can help me to convert words files to pure HTML in batch ?

Thanks

link|improve this question

72% accept rate
feedback

1 Answer

I found a macro for you. This macro can automatically convert a set of MS Word documents (with graphs and tables) to HTML format by cycling through all documents in a folder, opening them in Word and saving them as HTML files.

Sub SaveAllAsHTM()
Dim FirstLoop As Boolean
Dim myFile As String
Dim strDocName As String
Dim PathToUse As String
Dim MyDoc As Document
Dim Response As Long

PathToUse = InputBox("Path To Use?", "Path", "D:\My
Documents\Test\Versions")

On Error Resume Next
Documents.Close SaveChanges:=wdPromptToSaveChanges
FirstLoop = True
myFile = Dir$(PathToUse & "*.doc")
While myFile <> ""
Set MyDoc = Documents.Open(PathToUse & myFile)
If FirstLoop Then
'With ActiveDocument
'Selection.PageSetup.Orientation = wdOrientLandscape
'End With
FirstLoop = False

Response = MsgBox("Do you want to process " & _
"the rest of the files in this folder", vbYesNo)
If Response = vbNo Then Exit Sub
'Else
'With ActiveDocument
'Selection.PageSetup.Orientation = wdOrientLandscape
'End With
End If
strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".htm"
MyDoc.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatHTML
MyDoc.Close SaveChanges:=wdDoNotSaveChanges
myFile = Dir$()
Wend
End Sub 

Help on installing macros

link|improve this answer
Where should I put this macro and make it execute ? – Foolish Oct 26 '10 at 8:44
Check the link at the end of my answer. – Mehper C. Palavuzlar Oct 26 '10 at 8:45
Thanks, I will have a try . – Foolish Oct 26 '10 at 9:00
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.