OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

OOo macro code to java

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
_jmax
General User
General User


Joined: 31 May 2006
Posts: 23

PostPosted: Wed Jul 05, 2006 11:03 pm    Post subject: OOo macro code to java Reply with quote

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
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Thu Jul 06, 2006 9:49 am    Post subject: Reply with quote

I have tackled this subject, but with C++ here :
http://wiki.services.openoffice.org/wiki/Programming_OooWriter

Have also a look here :
How to invoke an OOo macro function in Java http://www.oooforum.org/forum/viewtopic.phtml?t=13587&highlight=
calling OOBasic macro from java http://www.oooforum.org/forum/viewtopic.phtml?t=32530&highlight=
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
_jmax
General User
General User


Joined: 31 May 2006
Posts: 23

PostPosted: Thu Jul 06, 2006 10:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Sat Jul 08, 2006 12:27 am    Post subject: Reply with quote

Sorry, I have no answer for that Embarassed
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group