Ask Your Question
0

IO exception performing storeAsUrl in Basic (Solved) [closed]

asked 2017-03-11 00:18:09 +0100

Pansmanser gravatar image

updated 2020-09-27 14:04:14 +0100

Alex Kemp gravatar image

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?

image description

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)

Ubuntu 16.04 LO 5.1.6.2

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-27 14:04:02.472453

1 Answer

Sort by » oldest newest most voted
0

answered 2017-03-11 16:41:38 +0100

Pansmanser gravatar image

Thanks to a tip from Rudolfo at https://forum.openoffice.org/en/forum... , I have the answer to this question. The correct filter is "writer8". However Rudolfo's answer was of much wider interest. He suggested using the macro recorder to find out the answer. Brilliant, thanks!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-11 00:18:09 +0100

Seen: 108 times

Last updated: Sep 27 '20