I’m trying to get a python script of mine to print a CSV file to the printer via Win32api.ShellExectute, I.E.
win32api.ShellExecute(0,"print","C:\Test.csv",None,".",0)
Here’s my problem: when I associate the file with Open Office, it just completely refuses to print. Prints fine in notepad. Prints fine in Microsoft Excel. Refuses to print in Open Office.
There’s no error message, either. If anyone knows a way to get an error message or SOMETHING at least I could try to work on it. I went to OpenOffice.org’s website and their wiki and all of their solutions are involving their integrated python macro scripting using the UNO module. I’m looking to call the print from a seperate application.
You’re relying on the shell defining a “print” verb for a particular file type. This works as follows:
All of those registry keys must be placed there by an installation program. When you associate a file type, you’re changing the lookup in step 2.
Edit: What I left unsaid is that there’s nothing to prevent you from correcting the ommision of a verb from a specific file type, as long as you can edit the registry and provide an appropriate command line.