Bonjour Christian Andersson
Message du 2006-10-01 11:50:
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())
From what you write, you have a macro named "main" inside a module
named "Main". I found problems if macro name is same as module name. And
Basic does not care about letter case. So use another name for your
macro or for your module.
Suggestion : Module1 ;)
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
This property does not exist. You should use "MacroExecutionMode"
(respect letter case).
asTemplate to true
This property should be written "AsTemplate" (respect letter case).
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
Seems to be similar to Issue 43544.
Explanation: OpenOffice first loads and runs macros instead of load the
document itself. This leads to many problems if a macro wants to access
any type of information in the document.
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]