I have a python application that needs to interact with an open MsWord document on Office for Mac ’04 and above. I know that on Windows I could use OLE automation to accomplish this, but I don’t think this is available on Mac OS. Is there any fairly simple way to accomplish this?
Edit: Sorry, I should clarify that I am not looking to edit the file. I want to make edits while Microsoft Office is actually open. For example, if the user types a keyword I want to be able to take a specific action.
You could consider using AppleScript, which was added in Microsoft Office:mac 2008.
Here’s an example:
http://pogue.blogs.nytimes.com/2008/02/01/applescript-code-for-microsoft-office-2008/
VBA has made a comeback in Office:mac 2011 (after being shelved in 2008; exists in 2004), so depending on your needs, that could be an option too.
Given your requirements, you might need some kind of hybrid system between those two. Or just insist on 2008 or later, and go with AppleScript.