I would like to ask for help in the following topic. I made this code called in IIS Web Service in order to create pdf file from office documents (Excel, Word, etc.):
Code: Select all
Dim oSM, oDesk, oDoc As Object 'OOo objects
Dim OpenParam(1) As Object 'Parameters to open the doc
Dim SaveParam(1) As Object 'Parameters to save the doc
oSM = CreateObject("com.sun.star.ServiceManager")
oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
OpenParam(0) = MakePropertyValue("Hidden", True) ' Open the file hidden
oDoc = oDesk.loadComponentFromURL("file:///" + docFile.Replace("\", "/").Replace("""", ""), "_blank", 0, OpenParam)
SaveParam(0) = MakePropertyValue("FilterName", "writer_pdf_Export")
Call oDoc.storeToURL("file:///" + pdfFile.Replace("\", "/").Replace("""", ""), SaveParam)
oDoc.Close(True)
oDesk = Nothing
oSM = Nothing
The server is a Windows 2012 server. I have already set the IIS Application Tools for Administrator rights.
I have also set the rights and identities of Component Services OpenOffice ServiceManagger for Administrator rights. I have set the rights on the File level, too.
I have tried all the solutions I found in Forums, but none of them works.
Please, help me if you can!
Thank you in advance!