A Python solution to convert Microsoft Word .doc files to .docx format on both Windows and macOS.
- Python 3.6 or higher
- Microsoft Word installed on your system
- On Windows:
pywin32
package (pip install pywin32
) - Tkinter (included with most Python installations)
- Clone or download this repository
- Ensure you have the required dependencies installed
This converter can be used in two ways:
Convert a .doc file to .docx (saves in the same directory):
python convertDoc2Docx.py path/to/document.doc
Specify output path:
python convertDoc2Docx.py path/to/document.doc path/to/output.docx
Launch the GUI application:
python doc_converter_gui.py
The GUI provides an easy-to-use interface with the following features:
- File browser to select input .doc files
- Optional output path selection
- Progress indication during conversion
- Status updates and error messages
- Simple one-click conversion
The converter uses different methods depending on your operating system:
- Windows: Uses the
win32com.client
library to automate Microsoft Word - macOS: Uses AppleScript via the
subprocess
module to automate Microsoft Word
convertDoc2Docx.py
- Core conversion functionality and command-line interfacedoc_converter_gui.py
- Graphical user interface for the converterREADME.md
- Documentation
- Requires Microsoft Word to be installed on your system
- Only supports Windows and macOS (not Linux)
- The input file must have a .doc extension
If you encounter an error about missing win32com.client
, install the pywin32 package:
pip install pywin32
Make sure Microsoft Word is installed and accessible. The script uses AppleScript to control Word, so Word must be able to open via AppleScript.
If the GUI doesn't appear or shows errors:
- Ensure Tkinter is properly installed with your Python installation
- Try running the command-line version to check if the core conversion works
- Check console output for any error messages
- Initial Release: Created convertDoc2Docx.py script with support for Windows and macOS
- Enhancement: Improved error handling, added input validation and custom output paths
- Feature: Added separate TKinter GUI application (doc_converter_gui.py)
- Documentation: Created comprehensive README with usage instructions for both CLI and GUI
- Update: Added explicit check for Microsoft Word installation on Windows, consistent with macOS version