Sub ExportFormFieldsToPdf(cFile) Dim oPropertyValue As new com.sun.star.beans.PropertyValue Dim oPropertyData As new com.sun.star.beans.PropertyValue Dim oPropertyDataValue As new com.sun.star.beans.PropertyValue cURL = convertToURL(cFile) oPropertyValue.Name = "Hidden" oPropertyValue.Value = True oDoc = StarDesktop.loadComponentFromURL(cURL, "_blank", 0, Array(oPropertyValue)) dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dispatcher.executeDispatch(oDoc.CurrentController.Frame, ".uno:UpdateAllIndexes", "", 0, Array()) GlobalScope.BasicLibraries.LoadLibrary("Tools") cFileNew = Tools.Strings.GetFileNameWithoutExtension(cFile) + ".pdf" cURL = ConvertToURL(cFileNew) oPropertyValue.Name = "FilterName" oPropertyValue.Value = "writer_pdf_Export" oPropertyDataValue.Name = "ExportFormFields" oPropertyDataValue.Value = 1 oPropertyData.Name = "FilterData" oPropertyData.Value = Array(oPropertyDataValue) oDoc.storeToURL(cURL, Array(oPropertyValue, oPropertyData)) oDoc.close(True) End Sub