| View previous topic :: View next topic |
| Author |
Message |
_jmax General User

Joined: 31 May 2006 Posts: 23
|
Posted: Wed Jul 05, 2006 11:03 pm Post subject: OOo macro code to java |
|
|
Hi,
i would like to know if it's possible to convert any OOo macro code in Java.
For example, this macro code :
| Code: | sub textToTab()
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
dim oSelection as Object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(4) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Delimiter"
args1(0).Value = CHR$(9)
args1(1).Name = "WithHeader"
args1(1).Value = true
args1(2).Name = "RepeatHeaderLines"
args1(2).Value = 1
args1(3).Name = "WithBorder"
args1(3).Value = true
args1(4).Name = "DontSplitTable"
args1(4).Value = false
dispatcher.executeDispatch(document, ".uno:ConvertTextToTable", "", 0, args1())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:ConvertTextToTable", "", 0, Array())
end sub
|
Another question : is it possible to use the Grammar Corrector from Java ?
Thank you
_jmax |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
_jmax General User

Joined: 31 May 2006 Posts: 23
|
Posted: Thu Jul 06, 2006 10:46 pm Post subject: |
|
|
Thank you SergeM,
I known how to call macro from Java,
so if i want to call a OOo feature like "ConvertTableToText", i have to use the Dispatcher as well.
Is it the same thing with the Grammar Corrector ?
_jmax |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|