Help!

Batch conversion DOC to HTML: free software?

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Conversions RSS
Next:  rtf broken (no images) with office 2003 service p..  
Author Message
Fred from NYC
External


Since: Feb 04, 2006
Posts: 5



PostPosted: Thu Feb 01, 2007 7:53 pm    Post subject: Batch conversion DOC to HTML: free software?
Archived from groups: microsoft>public>word>conversions (more info?)

I am looking for a free program that can automatically convert a set of
MS Word documents (with graphs and tables) to HTML format. Is there for
example a macro that can cycle through all documents in a folder, open
them in Word and save them as HTML files? Repeated Google searches only
turned up various programs that are sold for that purpose. I use MS Word
2003 and Windows XP. Many thanks for your help.
Back to top
Graham Mayor
External


Since: Jul 04, 2006
Posts: 4874



PostPosted: Fri Feb 02, 2007 11:42 am    Post subject: Re: Batch conversion DOC to HTML: free software? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You mean something different from the batch converter supplied with Word?

How about

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

http://www.gmayor.com/installing_macro.htm

I assume you are aware that the layout of the files will be different?
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Fred from NYC wrote:
> I am looking for a free program that can automatically convert a set
> of MS Word documents (with graphs and tables) to HTML format. Is
> there for example a macro that can cycle through all documents in a
> folder, open them in Word and save them as HTML files? Repeated
> Google searches only turned up various programs that are sold for
> that purpose. I use MS Word 2003 and Windows XP. Many thanks for your
> help.
Back to top
Fred from NYC
External


Since: Feb 04, 2006
Posts: 5



PostPosted: Fri Feb 02, 2007 4:25 pm    Post subject: Re: Batch conversion DOC to HTML: free software? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Graham, thank you, this is exactly what I was looking for. The macro
works great and the layout changes are not a problem.

Graham Mayor wrote:
> You mean something different from the batch converter supplied with Word?
>
> How about
>
> Sub SaveAllAsHTM()
> [snip]
> End Sub
>
> http://www.gmayor.com/installing_macro.htm
>
> I assume you are aware that the layout of the files will be different?
Back to top
Graham Mayor
External


Since: Jul 04, 2006
Posts: 4874



PostPosted: Sat Feb 03, 2007 2:22 pm    Post subject: Re: Batch conversion DOC to HTML: free software? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I would have thought the batch conversion wizard supplied woiuld have done
the job - the macro was a mere modification from one designed to do
something else, but if it works for you ...... Smile

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Fred from NYC wrote:
> Graham, thank you, this is exactly what I was looking for. The macro
> works great and the layout changes are not a problem.
>
> Graham Mayor wrote:
>> You mean something different from the batch converter supplied with
>> Word? How about
>>
>> Sub SaveAllAsHTM()
>> [snip]
>> End Sub
>>
>> http://www.gmayor.com/installing_macro.htm
>>
>> I assume you are aware that the layout of the files will be
>> different?
Back to top
tiga2001



Joined: Jun 10, 2010
Posts: 1



PostPosted: Fri Jun 11, 2010 12:32 am    Post subject: Thanks! [Login to view extended thread Info.]

Hi, I know this is an old topic, and most people probably have Office 2007, but my office still uses Office 2003 and that's what I prefer anyways. I don't know if this script will work for Word 2007 but I just want to say that it worked great for Word 2003. The built-in batch conversion wizard failed with a "Automation Error." Typical Microsoft product behavior :-/.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Conversions All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum