In Open office I have created a macro for printing documents.
sub printDoc(FileName)
Dim Url as String
Url = convertToUrl(FileName)
Dim Doc as variant
Doc = starDeskTop.loadComponentFromUrl(Url, "_hidden", 0, Array())
Doc.Print(Array())
Doc.Close(True)
End Sub
I call this macro from my c# program, the macro launches and the document prints however the macro errors when it gets to the line “Doc.Close(True)” and sometimes locks up the computer until the program is ended though task manager. Is there something I should be doing differently? Please let me know if you need any additional information.
-Thanks
Here is what worked (I have an open document function)
The important part is:
this makes sure we aren’t trying to close the document while we are trying to print it.
Source:
http://user.services.openoffice.org/en/forum/viewtopic.php?f=5&t=40719