Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "c:/Program Files/LibreOffice/program/soffice" --nologo --norestore --nolockcheck "macro:///Standard.Module2.PysIndexer(C:wampwwwsitepublicfile.docx)"
- sub PysIndexer(docPath as string)
- dim document as object
- dim dispatcher as object
- dim pdfPath as string
- dim args1(0) as new com.sun.star.beans.PropertyValue
- dim args2(0) as new com.sun.star.beans.PropertyValue
- if fileExists(docPath) then
- args1(0).Name = "Hidden"
- args1(0).Value = True
- args2(0).Name = "FilterName"
- args2(0).Value = "writer_pdf_Export"
- document = starDesktop.loadComponentFromUrl(convertToUrl(docPath), "_blank", 0, args1())
- dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
- dispatcher.executeDispatch(document.CurrentController.Frame, ".uno:UpdateAllIndexes", "", 0, array())
- GlobalScope.BasicLibraries.LoadLibrary("Tools")
- pdfPath = GetFileNameWithoutExtension(docPath) & ".pdf"
- document.storeToURL(convertToUrl(pdfPath), args2())
- document.close(True)
- end if
- end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement