I've asked experts and looked all over the web. I want to convert a batch of Works wps files to Word 97-2003 files. I repaired a computer that had been using Works and they lost the CD to install Works and now have a program that will read Word but not Works. I can do it one at a time but not 100 at once.
If you have the wps converter installed, as appears to be the case, the following macro will convert all the WPS format files in a selected folder to Word 97-2003 format. Sub Batch_Save_WPS_as_DOC97() Dim bConv As Boolean Dim strFileName As String Dim strDocName As String Dim strPath As String Dim oDoc As Document Dim Response As Long Dim fDialog As FileDialog bConv = Options.ConfirmConversions Options.ConfirmConversions = False 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", , "Save all as DOC" 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 strFileName = Dir$(strPath & "*.wps") 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 Options.ConfirmConversions = bConv 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 <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Jay wrote: > I've asked experts and looked all over the web. I want to convert > a batch of Works wps files to Word 97-2003 files. I repaired a > computer that had been using Works and they lost the CD to install > Works and now have a program that will read Word but not Works. > > I can do it one at a time but not 100 at once.
Thanks for the macro - it worked great! "Graham Mayor" wrote: > If you have the wps converter installed, as appears to be the case, the > following macro will convert all the WPS format files in a selected folder > to Word 97-2003 format. > > > Sub Batch_Save_WPS_as_DOC97() > Dim bConv As Boolean > Dim strFileName As String > Dim strDocName As String > Dim strPath As String > Dim oDoc As Document > Dim Response As Long > Dim fDialog As FileDialog > > bConv = Options.ConfirmConversions > Options.ConfirmConversions = False > 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", , "Save all as DOC" > 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 > > strFileName = Dir$(strPath & "*.wps") > > 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 > Options.ConfirmConversions = bConv > 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 > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > > > Jay wrote: > > I've asked experts and looked all over the web. I want to convert > > a batch of Works wps files to Word 97-2003 files. I repaired a > > computer that had been using Works and they lost the CD to install > > Works and now have a program that will read Word but not Works. > > > > I can do it one at a time but not 100 at once. > > >