convert from 2007 to 2003

K

kingmall

Does anyone have a way to quickly take a set of word documents that are in
2007 format and save them as 2003 format? I don't want to have to open each
document, then click saveas, then choose 97-2003. And I don't want to set my
options to always save to 97-2003. It seems like maybe a macro could do it,
but I don't know if that will produce the easiest method for the end-user or
if it's even possible. Any advice is greatly appreciated.
 
D

Doug Robbins - Word MVP

Modify the code in the article "Find & ReplaceAll on a batch of documents in
the same folder" at:

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

so that it just opens each document and saves it in the desired format.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
K

kingmall

Thanks for the input Doug. However, I've never really messed with macros
before. I tried copy/pasting that code into a new module (Module1) in my
"Normal.dotm" file. Then I saved it and closed Word. Then I re-opened Word,
opened the "Macros" dialog box, highlighted the new module (BatchReplaceAll)
and clicked "Run" and the only thing that happened was the default document
(Document1) closed, but Word remained open. And I wasn't prompted to do
anything. Do have any suggestions on how I can try and figure out what I'm
doing wrong? I didn't modify the code at all. I just wanted to see if I could
even get it to work as is, before I start trying to modify it (which I really
have no idea how I'm going to do that, but I should be able to figure it out
eventually).
 
J

Jonathan West

Hi kingmall

If you did a full install of office, you should have something called the
"Batch conversion wizard" available on one of the tabs of the Templates
dialog (the dialog which appears when you create a new file). Follow the
steps in the wizard to convert a folder full of files to the format you
require.
 
K

kingmall

I thought I did a full install, but I don't see it. That sounds like just
what I need!!! I will uninstall Office 2007 and reinstall it and hopefully it
will show up. Thanks for the input!
 
K

kingmall

Ok, I uninstalled Office 2007. I restarted my computer. I double-clicked
"setup.exe", Then I clicked "Customize", then I clicked on the small black
arrow next to "Microsoft Office" and chose "Run all from my computer", Then I
clicked "Install Now" (When I was looking through all of the 'customizable
options', I didn't see anything about a batch conversion wizard). And there's
nothing in the help menu regarding it either. When you go into the "About"
what does yours say? Mine says, "Microsoft Office Word 2007 (12.0.4518.1014)
MSO (12.0.4518.1014) Part of Microsoft Office Professional Plus 2007" I even
searched around on Microsoft's website and I did not find any search results
regarding a batch conversion wizard for Office 2007. It seems like you maybe
using an earlier version of Office, and they got rid of this feature in
Office 2007. THIS SUCKS!!!!!!!!!!!!!!!!!!!!!!
 
J

Jonathan West

kingmall said:
Ok, I uninstalled Office 2007. I restarted my computer. I double-clicked
"setup.exe", Then I clicked "Customize", then I clicked on the small black
arrow next to "Microsoft Office" and chose "Run all from my computer",
Then I
clicked "Install Now" (When I was looking through all of the 'customizable
options', I didn't see anything about a batch conversion wizard). And
there's
nothing in the help menu regarding it either. When you go into the "About"
what does yours say? Mine says, "Microsoft Office Word 2007
(12.0.4518.1014)
MSO (12.0.4518.1014) Part of Microsoft Office Professional Plus 2007" I
even
searched around on Microsoft's website and I did not find any search
results
regarding a batch conversion wizard for Office 2007. It seems like you
maybe
using an earlier version of Office, and they got rid of this feature in
Office 2007. THIS SUCKS!!!!!!!!!!!!!!!!!!!!!!

When I saw you were using office 2007, I thought I'd better check. It wasn't
clear before whether you were actually using 2007, as there are file
converters available that allow you to read 2007 files in 2003. The batch
conversion wizard is in 2003 and has been for every version since about
Office 95.

I'm afraid it does seem like they have dropped the batch conversion wizard
from 2007. I apologise for having misled you.
 
K

kingmall

That's ok. I can't believe they got rid of it. *#@%!!!!!!!!!!!!!!!!!!!!
Well, hopefully someone can come up with an easy to use macro that can do it.
I'll be waiting...
 
K

kingmall

This macro seems like it would work, if I knew how to modify it so that a
user simply clicks a button and is prompted for a directory to browse to
(then the macro should simply open each file and saveas 97-2003 format). Here
is the macro, do you have any idea on how to modify so it work for me?

Option Explicit

Public Sub BatchReplaceAll()

Dim FirstLoop As Boolean
Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document
Dim Response As Long

PathToUse = "C:\Test\"

'Error handler to handle error generated whenever
'the FindReplace dialog is closed

On Error Resume Next

'Close all open documents before beginning

Documents.Close SaveChanges:=wdPromptToSaveChanges

'Boolean expression to test whether first loop
'This is used so that the FindReplace dialog will
'only be displayed for the first document

FirstLoop = True

'Set the directory and type of file to batch process

myFile = Dir$(PathToUse & "*.doc")

While myFile <> ""

'Open document
Set myDoc = Documents.Open(PathToUse & myFile)

If FirstLoop Then

'Display dialog on first loop only

Dialogs(wdDialogEditReplace).Show

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

'On subsequent loops (files), a ReplaceAll is
'executed with the original settings and without
'displaying the dialog box again

With Dialogs(wdDialogEditReplace)
.ReplaceAll = 1
.Execute
End With

End If

'Close the modified document after saving changes

myDoc.Close SaveChanges:=wdSaveChanges

'Next file in folder

myFile = Dir$()

Wend

End Sub
 
K

kingmall

Jonathan, I'm considering installing Office 2003 on one machine for the sole
purpose of getting the batch conversion wizard back. Are you saying that if I
only have Office 2003 installed on the machine, if I do a full install, I'll
be able to batch convert Word 2007 files to Word 97-2003?
 
K

kingmall

Well, I left Word 2007 on the machine, and installed Word 2003, and it works.
I get some confilcts with the Normal.dot template file when I close Word 2003
which I would like to stop from happening, but it's not a huge deal. At least
I can batch convert now.
 
K

kingmall

I take that back, it doesn't work so well with Word 2007 still on there. I
opened one of the files that I converted to 97-2003 and it opened in Word
2007. But before it opened, it had to reconfigure Office 2007. Now I can't
even open Word 2003 anymore! This totally sucks!!! So, I guess I will have to
uninstall Office 2007 and Word 2003, and just install Office 2003 on this
machine. What a hastle!!! If only they would have just left it alone!!!!!!!!
 
G

Graham Mayor

The following should work (on Word 2007) to convert docx files in a folder
to doc. The original docx files are retained.

Sub SaveAllAsDOC()
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 & "*.docx")

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

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

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


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jonathan West

kingmall said:
Jonathan, I'm considering installing Office 2003 on one machine for the
sole
purpose of getting the batch conversion wizard back. Are you saying that
if I
only have Office 2003 installed on the machine, if I do a full install,
I'll
be able to batch convert Word 2007 files to Word 97-2003?

You'll need to do a full install of Office 2003 and then download & install
the Office 2007 compatibility pack so that Office 2003 can read the 2007
file formats. You can get that from here

http://www.microsoft.com/downloads/...70-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en

Then, you should have no problem using the Batch conversion wizard to
convert between 2003 and 2007 files
 
J

Jonathan West

You can install VirtualPC ( a free download from Microsoft) to set up a
virtual machine on your PC which can then have Office 2003 installed on it.
 
K

kingmall

THAT'S PERFECT!!! THANKS ALOT!!!

Graham Mayor said:
The following should work (on Word 2007) to convert docx files in a folder
to doc. The original docx files are retained.

Sub SaveAllAsDOC()
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 & "*.docx")

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

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

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


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
K

kingmall

Thanks, but I used Graham's macro and it works.

Jonathan West said:
You'll need to do a full install of Office 2003 and then download & install
the Office 2007 compatibility pack so that Office 2003 can read the 2007
file formats. You can get that from here

http://www.microsoft.com/downloads/...70-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en

Then, you should have no problem using the Batch conversion wizard to
convert between 2003 and 2007 files


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
 
K

kingmall

Actually, is there any way you can modify it so that it does not pop up the
window that says "Cancelled by user" ? That would be great!
 
G

Graham Mayor

Remove the line
MsgBox "Cancelled By User", , "List Folder Contents"
which will keep the error trapping but not give the message

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top