Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Document Management / May 2008

Tip: Looking for answers? Try searching our database.

Batch Conversion Wizard in 2007?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joyce - 23 May 2008 20:41 GMT
Word 2003 had a nifty batch conversion wizard for converting a whole bunch of
docs to HTML. Is there something comparable in Word 2007? I know that you can
use "Save As" to save a single document, but I have a whole bunch to be
converted.
Graham Mayor - 24 May 2008 06:53 GMT
You could use a macro

Sub SaveAllAsHTML()
Dim strFileName As String
Dim strDocName As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
   .Title = "Select folder and click OK"
   .AllowMultiSelect = False
   .InitialView = msoFileDialogViewList
   If .Show <> -1 Then
       MsgBox "Cancelled By User", , "List Folder Contents"
       Exit Sub
   End If
   strPath = fDialog.SelectedItems.Item(1)
   If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
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 & ".htm"
   oDoc.SaveAs FileName:=strDocName, _
       FileFormat:=wdFormatHTML
   oDoc.Close SaveChanges:=wdDoNotSaveChanges
   strFileName = Dir$()
Wend
End Sub

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

Signature

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

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

> Word 2003 had a nifty batch conversion wizard for converting a whole
> bunch of docs to HTML. Is there something comparable in Word 2007? I
> know that you can use "Save As" to save a single document, but I have
> a whole bunch to be converted.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.