Looking for simple (batch) .doc to .docx converter (willing to pay). Initiator des Themas: Michael Beijer
| Michael Beijer Vereinigtes Königreich Local time: 19:29 Mitglied (2009) Niederländisch > Englisch + ... | Shai Navé Israel Local time: 21:29 Englisch > Hebräisch + ...
You just have to group all the files that you need to convert in one folder, open the first, and run this macro. Maybe it doesn't have all the bells and whistles that other converters might have, but for a simple batch conversion process this is an effective and efficient solution.
[Edited at 2013-11-14 12:51 GMT] | | | Michael Beijer Vereinigtes Königreich Local time: 19:29 Mitglied (2009) Niederländisch > Englisch + ... THEMENSTARTER Thanks Shai! | Nov 14, 2013 |
Wow, that was easy. Saved myself some money and I now have a nice little icon (a smiley face) above my ribbon that runs your macro. Michael Here's the macro: Sub SaveAllDOCX() Dim strFilename As String Dim strDocName As String Dim strPath As String Dim oDoc As Document Dim fDialog As FileDialog Dim intPos As Integer 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 & ".docx" oDoc.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatDocumentDefault oDoc.Close SaveChanges:=wdDoNotSaveChanges strFilename = Dir$() Wend End Sub
[Edited at 2013-11-14 13:14 GMT] | | | Michael Beijer Vereinigtes Königreich Local time: 19:29 Mitglied (2009) Niederländisch > Englisch + ... THEMENSTARTER syntax error | Dec 17, 2013 |
Hi Shai, For some reason the macro doesn't work on my Win7 installation of Word 2013. It worked fine on my Windows 8 PC. I'm getting a syntax error at this line: Sub SaveAllDOCX() Dim strFilename As String Dim strDocName As String Dim strPath As String Dim oDoc As Document Dim fDialog As FileDialog Dim intPos As Integer Set fDialog = Application.FileDialog(msoFileDialogFolderPicker) With fDialog ... See more Hi Shai, For some reason the macro doesn't work on my Win7 installation of Word 2013. It worked fine on my Windows 8 PC. I'm getting a syntax error at this line: Sub SaveAllDOCX() Dim strFilename As String Dim strDocName As String Dim strPath As String Dim oDoc As Document Dim fDialog As FileDialog Dim intPos As Integer 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 & ".docx" oDoc.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatDocumentDefault oDoc.Close SaveChanges:=wdDoNotSaveChanges strFilename = Dir$() Wend End Sub Any idea why? Michael ▲ Collapse | |
|
|
Shai Navé Israel Local time: 21:29 Englisch > Hebräisch + ... If you copied the code from your earlier post here then there are parts missing | Dec 17, 2013 |
Use the code here instead and see if it works. | | | Michael Beijer Vereinigtes Königreich Local time: 19:29 Mitglied (2009) Niederländisch > Englisch + ... THEMENSTARTER Thanks Shai, | Dec 17, 2013 |
This one works! Michael | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Looking for simple (batch) .doc to .docx converter (willing to pay). Trados Business Manager Lite | Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.
More info » |
| Anycount & Translation Office 3000 | Translation Office 3000
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |