![]() |
|
#2
|
||||
|
||||
|
You can convert a whole folder of documents with a simple macro:
Code:
Sub ConvertFiles()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String, wdDoc As Document
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
While strFile <> ""
If InStrRev(strFile, ".docx") = 0 Then
Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, _
AddToRecentFiles:=False, Visible:=False)
wdDoc.SaveAs2 FileName:=strFolder & "\" & Left(strFile, InStrRev(strFile, ".doc")) & "docx", _
Fileformat:=wdFormatXMLDocument, AddToRecentFiles:=False
wdDoc.Close SaveChanges:=False
End If
strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
MS Word 2010 Content Controls and PDF Conversion.
|
MaxInCO | Word | 3 | 02-13-2014 12:58 PM |
Word 2003 Macro problem running in Word 2010
|
norwood | Word VBA | 2 | 02-03-2014 06:49 PM |
Graphics Created in Word 2003 Cannot Be Displayed in Word 2010
|
mwildem | Drawing and Graphics | 3 | 02-14-2013 10:59 AM |
| Are user customizations transferable from Word 2003 to Word 2010 (2013)? | New Daddy | Word | 3 | 01-14-2013 07:25 AM |
| trying to open a word 2010 document and opens the file conversion window | starfish | Word | 2 | 05-24-2012 12:06 AM |