The following code snippet was working ok. The full routine reads a form, fills in the blanks, and does a “Save As”. However, when I modified the routine to add a .png to the form, the storeAsUrl began to generate an exception.
I suspect the problem is the filter, and I have tried various, but without success. If it makes any difference, the code resides in a base file, but generates a writer document obviously.
Any suggestions, please?
oDoc = StarDesktop.LoadComponentFromUrl(ConvertToURL(sFileName), "_blank", 0, Args()) ... sFileName = sPath & "HSFReport_" & sClient & "_" & sScaleNo & ".odt" Dim oArgs(1) As New com.sun.star.beans.PropertyValue oArgs(0).Name = "FilterName" oArgs(0).Value = "StarOffice XML (Writer)" oArgs(1).Name = "Overwrite" oArgs(1).Value = true oDoc.StoreAsURL(ConvertToURL(sFileName), oArgs)