read answers inline
Bernard Marcelly wrote:
> 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 ;)
well to be honest, I changed the name of the macro when writing the
above, since I thought it would be easier to read compared to the
strange name we have in the code :-)
so this should not be the problem. library/module/macro names are all
different.
>>
>> 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).
ofcourse, a typo when typing this message, it is MacroExecutionMode in
the code
>
>> asTemplate to true
>
> This property should be written "AsTemplate" (respect letter case).
This is also a typo in this message. I was a little stressed and did not
have the code infront of me when writing.
>> 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.
this is one of the reasons that we want to call the macro from vb and
not on any "load/create" event.
>
> Bernard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
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]