Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Raroboy Raroboy is offline
external usenet poster
 
Posts: 1
Default Can I batch convert files to word?

I recently installed Office 2007. I have about 700 files in the .html format
and I want to convert them into Office .docx files. I know how to do this on
a single basis but I would like to know if I can do a batch conversion. The
..html files are email letters that I want to put into .docx format so I can
write a book. Any Ideas?
thanks
Paul
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Can I batch convert files to word?

The following macro will convert all the files from a folder selected from
the macro. Ensure that Word Options Advanced General Confirm file
conversion on open is NOT checked or you will have to confirm 700 times! -
http://www.gmayor.com/installing_macro.htm

Sub SaveAllAsDOCX()
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 & "*.htm")

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

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


--

Graham Mayor - Word MVP

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


Raroboy wrote:
I recently installed Office 2007. I have about 700 files in the .html
format and I want to convert them into Office .docx files. I know how
to do this on a single basis but I would like to know if I can do a
batch conversion. The .html files are email letters that I want to
put into .docx format so I can write a book. Any Ideas?
thanks
Paul



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to - batch/mass convert word 2003 documents to 2007 xml docume CoachBill Microsoft Word Help 1 February 27th 07 02:50 AM
how do i batch convert from .doc to .htm in Word 2007? fitz Microsoft Word Help 4 February 17th 07 05:38 PM
How do I do a batch conversion of Wordperfect .dat files to Word? BLCinD Microsoft Word Help 1 February 17th 07 06:03 AM
How do you format a batch of word files? Ericpayne Microsoft Word Help 1 December 10th 06 04:34 PM
How can I automatically rename a whole batch of word files? catmanbaloo Microsoft Word Help 1 March 24th 05 10:27 PM


All times are GMT +1. The time now is 03:35 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"