Are there any command-line tools or python APIs which can help to check multiple Word and PowerPoint documents for accessibility issues automatically/programmatically?
CodePudding user response:
Object models of both applications don't provide anything for running the accessibility checker. The best what you could to is to automate the UI by using Windows API functions such as Microsoft Active Accessibility (or any wrappers around that API).
Microsoft Active Accessibility is a Component Object Model (COM)-based technology that improves the way accessibility aids work with applications running on Microsoft Windows. It provides dynamic-link libraries that are incorporated into the operating system as well as a COM interface and API elements that provide reliable methods for exposing information about UI elements.
CodePudding user response:
For command-line tools, you can try using:
- LibreOffice CLI: LibreOffice provides a Command Line Interface (CLI) tool that can be used to perform various document operations, including checking for accessibility issues.
For Python APIs, you can try using:
python-docx: A library for working with Microsoft Word (.docx) files. It allows you to extract the text from a Word document and check it for accessibility issues.
python-pptx: A library for working with Microsoft PowerPoint (.pptx) files. It allows you to extract the text and images from a PowerPoint presentation and check them for accessibility issues.
accessibility-checker: A Python library that uses the Microsoft Office UI Automation API to check documents for accessibility issues.