Hi there, I'm trying to integrate openoffice (2.0.3) into an web-based
application (that today is using word)
but I have now come up against a small problem.
I need to call a macro inside an writer document from a visual basic
script that is running inside internet explorer.
I have no problem opening the writer document from the visual basic
script, I can also manipulate the document from the script, but after
all of this is done I need to call a macro inside the document. but
sofar I have not come up with a sollution.
I have tried the new scripting system like this.
oScriptProvider = oDoc.getScriptProvider()
oScript =
oScriptProvider.getScript("vnd.sun.star.script:Standard.Main.main?language=Basic&location=document")
oScript.invoke(Array(),Array(),Array())
unfourtunally I have some problem getting the error handling working so
all I can say is that I get some kind of error/exception with the
getScript("vnd..... function
I have also tried using the dispatcher to call the macro
oDispatch.exeutedispatch("macro:///Standard.Main.main()","",0,Array())
oDispatch.exeutedispatch("macro:///vnd.sun.star.script:Standard.Main.main()","",0,Array())
oDispatch.exeutedispatch("macro:///vnd.sun.star.script:Standard.Main.main?language=basic&location=document","",0,Array())
oDispatch.exeutedispatch("macro://"+docname+"/Standard.Main.main()","",0,Array())
oDispatch.exeutedispatch("macro://"+docname+"/vnd.sun.star.script:Standard.Main.main()","",0,Array())
oDispatch.exeutedispatch("macro://"+docname+"/vnd.sun.star.script:Standard.Main.main?language=basic&location=document","",0,Array())
but no luck, there is no error when using the dispatch, but the script
is not called.
The document is opened visible so it should not be related to the bug
#69552 (*1)
The document opened is a template, but when I'm using
loadComponentFromUrl I have set the properties
ExecuteMacroMode to 4
asTemplate to true
if I dont add asTemplate = true, the macros I have on the "oncreate"
event will not be called. and the macro security is currently set to low
so It i snot that problem either
can anyone shed som light on this?
*1 http://qa.openoffice.org/issues/show_bug.cgi?id=69552
--
Christian Andersson - [EMAIL PROTECTED]
Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]