PC Review


Reply
Thread Tools Rate Thread

Batch conversion of Word 2007 to html

 
 
=?Utf-8?B?UlNSIEZBUk0=?=
Guest
Posts: n/a
 
      24th Oct 2007
I have a large number of Word files that I have to convert to html and would
like to do a batch conversion verses doing them one by one. Is there an easy
way to accomplish this? Any help would be appreciated.

Ron
 
Reply With Quote
 
 
 
 
Graham Mayor
Guest
Posts: n/a
 
      25th Oct 2007
How about

Sub SaveAllAsHTML()
Dim strFileName As String
Dim strDocName As String
Dim strPath As String
Dim oDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
strPath = .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(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc?")

While Len(strFileName) <> 0
Set oDoc = Documents.Open(strPath & strFileName)

strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".html"
oDoc.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatHTML
oDoc.Close SaveChanges:=wdDoNotSaveChanges
strFileName = Dir$()
Wend
End Sub

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

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

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

RSR FARM wrote:
> I have a large number of Word files that I have to convert to html
> and would like to do a batch conversion verses doing them one by one.
> Is there an easy way to accomplish this? Any help would be
> appreciated.
>
> Ron



 
Reply With Quote
 
=?Utf-8?B?UlNSIEZBUk0=?=
Guest
Posts: n/a
 
      25th Oct 2007
Graham:

Thanks for the reply but your suggestions is 'over my head'! Prior versions
of Word had a batch conversion Wizard and it was easy to make such
conversions. I have searched Word 2007 for the batch conversion Wizard and
it does not seem to exist. Was this feature omitted?

Thanks again.

Ron

"Graham Mayor" wrote:

> How about
>
> Sub SaveAllAsHTML()
> Dim strFileName As String
> Dim strDocName As String
> Dim strPath As String
> Dim oDoc As Document
>
> With Dialogs(wdDialogCopyFile)
> If .Display <> 0 Then
> strPath = .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(strPath, 1) = Chr(34) Then
> strPath = Mid(strPath, 2, Len(strPath) - 2)
> End If
> strFileName = Dir$(strPath & "*.doc?")
>
> While Len(strFileName) <> 0
> Set oDoc = Documents.Open(strPath & strFileName)
>
> strDocName = ActiveDocument.FullName
> intPos = InStrRev(strDocName, ".")
> strDocName = Left(strDocName, intPos - 1)
> strDocName = strDocName & ".html"
> oDoc.SaveAs FileName:=strDocName, _
> FileFormat:=wdFormatHTML
> oDoc.Close SaveChanges:=wdDoNotSaveChanges
> strFileName = Dir$()
> Wend
> End Sub
>
> http://www.gmayor.com/installing_macro.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> RSR FARM wrote:
> > I have a large number of Word files that I have to convert to html
> > and would like to do a batch conversion verses doing them one by one.
> > Is there an easy way to accomplish this? Any help would be
> > appreciated.
> >
> > Ron

>
>
>

 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      25th Oct 2007
It's just a simple macro - the link at the end of my earlier reply explains
how to install such listings. All you have to do is run the macro?

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

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

RSR FARM wrote:
> Graham:
>
> Thanks for the reply but your suggestions is 'over my head'! Prior
> versions of Word had a batch conversion Wizard and it was easy to
> make such conversions. I have searched Word 2007 for the batch
> conversion Wizard and it does not seem to exist. Was this feature
> omitted?
>
> Thanks again.
>
> Ron
>
> "Graham Mayor" wrote:
>
>> How about
>>
>> Sub SaveAllAsHTML()
>> Dim strFileName As String
>> Dim strDocName As String
>> Dim strPath As String
>> Dim oDoc As Document
>>
>> With Dialogs(wdDialogCopyFile)
>> If .Display <> 0 Then
>> strPath = .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(strPath, 1) = Chr(34) Then
>> strPath = Mid(strPath, 2, Len(strPath) - 2)
>> End If
>> strFileName = Dir$(strPath & "*.doc?")
>>
>> While Len(strFileName) <> 0
>> Set oDoc = Documents.Open(strPath & strFileName)
>>
>> strDocName = ActiveDocument.FullName
>> intPos = InStrRev(strDocName, ".")
>> strDocName = Left(strDocName, intPos - 1)
>> strDocName = strDocName & ".html"
>> oDoc.SaveAs FileName:=strDocName, _
>> FileFormat:=wdFormatHTML
>> oDoc.Close SaveChanges:=wdDoNotSaveChanges
>> strFileName = Dir$()
>> Wend
>> End Sub
>>
>> http://www.gmayor.com/installing_macro.htm
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>> RSR FARM wrote:
>>> I have a large number of Word files that I have to convert to html
>>> and would like to do a batch conversion verses doing them one by
>>> one. Is there an easy way to accomplish this? Any help would be
>>> appreciated.
>>>
>>> Ron



 
Reply With Quote
 
Uni Bull
Guest
Posts: n/a
 
      25th Dec 2007
"Graham Mayor" <(E-Mail Removed)> skrev i en meddelelse
news:(E-Mail Removed)...
> How about
>

[cut]
....batch conversion of doc>html
[cut]

> http://www.gmayor.com/installing_macro.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP


Wow - any chance that something similar would be possible as
a "Batch conversion to .pdf"-macro?

I have installed the Word 2007 "Save as pdf" add-in. But it's
a nightmare if I have to manually save all the docs as pdf...

--
Regards,

Uni Bull
Denmark


 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      25th Dec 2007
Answered in reply to your separate question.

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

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

Uni Bull wrote:
> "Graham Mayor" <(E-Mail Removed)> skrev i en meddelelse
> news:(E-Mail Removed)...
>> How about
>>

> [cut]
> ...batch conversion of doc>html
> [cut]
>
>> http://www.gmayor.com/installing_macro.htm
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP

>
> Wow - any chance that something similar would be possible as
> a "Batch conversion to .pdf"-macro?
>
> I have installed the Word 2007 "Save as pdf" add-in. But it's
> a nightmare if I have to manually save all the docs as pdf...



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file conversion to Word 2007 Ned23 Microsoft Word Document Management 12 12th Dec 2008 07:16 AM
Batch Conversion Wizard in 2007? Joyce Microsoft Word Document Management 1 24th May 2008 06:53 AM
Batch conversion of Word>pdf Uni Bull Microsoft Word Document Management 1 25th Dec 2007 06:33 AM
after batch conversion can't open a word doc in word 2003 =?Utf-8?B?c3F1ZWFrcw==?= Microsoft Word Document Management 0 1st Jun 2006 07:53 PM
Word Batch Conversion =?Utf-8?B?QyBHb2ViZWw=?= Microsoft Word Document Management 6 8th Mar 2005 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 AM.