Terry wrote:
Hi. Several times a day, it seems, I discover another reason for staying with 2.0.2.

I've recorded exporting to xhtml. The code is below. I wondered whether that was your intention.

I stepped back from looking into the StarBasic way of doing this without the dispatcher but I think you would use ThisComponent.storeToUrl. Anyway, the process was recorded as follows:

sub recExportXhtml
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///home/terry/Data/WorkRef/Test/Test.xhtml"
args1(1).Name = "FilterName"
args1(1).Value = "XHTML Calc File"
args1(2).Name = "SelectionOnly"
args1(2).Value = true

dispatcher.executeDispatch(document, ".uno:ExportTo", "", 0, args1())


end sub
It occurred to me that a macro using the dispatcher may crash your OOo as well. The following seems to achieve the same result as the menu command (hopefully, without causing a crash in your case):

Sub exportXhtml

Dim oDoc as Object, oSheet as Object, sSheetName as String, sPath as String, _
   sUrl as String, aArgs( 1 ) as new com.sun.star.beans.PropertyValue

oDoc = ThisComponent : oSheet = oDoc.getCurrentController.ActiveSheet
sSheetName = oSheet.getName : sPath = "/home/terry/Data/WorkRef/Test/" 'change this, obviously
sUrl = ConvertToUrl( sPath & sSheetName & ".xhtml" )

aArgs( 0 ).Name = "FilterName"
aArgs( 0 ).Value = "XHTML Calc File"
aArgs( 1 ).Name = "SelectionOnly" ' ** Appears to be undocumented and meaning unknown.
aArgs( 1 ).Value = true

oDoc.storeToUrl( sUrl, aArgs() )

End Sub

--

If you're seeking, check out http://www.rci.org.au

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to