Batch html converter for word 2003???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a batch converter to convert a folder with .doc files to .html files. I'm using word 2003. Is there any tool I can download?
 
Put them all in a folder on their own and run the following macro

Public Sub BatchSaveAsHTML()
Dim myFile As String
Dim myHTML As String
Dim myLen As String
Dim myLen2 As String
Dim PathToUse As String
Dim myDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
PathToUse = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With

If Documents.Count > 0 Then
Documents.Close Savechanges:=wdPromptToSaveChanges
End If

If Left(PathToUse, 1) = Chr(34) Then
PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2)
End If

myFile = Dir$(PathToUse & "*.doc")

While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
myLen = Len(myFile)
myLen2 = myLen - 3
myHTML = Left(myFile, myLen2) & "HTM"
myDoc.SaveAs FileName:=myHTML, FileFormat:=wdFormatHTML
myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub

See http://www.gmayor.com/installing_macro.htm if you don't know how to use
this listing
--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
Back
Top