Apache OpenOffice (AOO) Bugzilla – Issue 33662
Macros in writer-documents loaded by LoadComponentFromURL don't work
Last modified: 2013-02-24 21:07:54 UTC
When opening a new document with a Basic Macro assigned to a push button with this code >>Sub Open_Document >>Dim mArgs(2) as New com.sun.star.beans.PropertyValue >>Dim oDocument as Object >>mArgs(0).Name = "ReadOnly" >>mArgs(0).Value = True >>mArgs(1).Name = "MacroExecMode" >>mArgs(1).Value = 4 >>mArgs(2).Name = "AsTemplate" >>mArgs(2).Value = FALSE >>oDocument = >>ThisComponent.getCurrentController.GetFrame.loadComponentFromURL("The_Filepath","_blank",0, mArgs()) >>End Sub Macros don't work in the newly opened document that has push buttons either. It makes no difference when using - macro:// - URLs or the integrated Macro assigning feature. - opening the document as template or not (when opening a Template, macro:// - assigned buttons get a "no privileges message" although the options security dialog is set to "always run") - any of the MacroExecMode modes or not - _self, _blank or any other frame - Stardesktop.getCurrentController..... instead of ThisComponent...... - a ThisComponent.reload function when the new document is opened - the global macro library or the documents library This also doesn't work in the 1.9 m51 of the Developers Build Regards Helge
forgot to say that I also tried ReadOnly True or False with all other combinations
This is not a bug, it's your mistake: It's >>mArgs(1).Name = "MacroExecutionMode" >>mArgs(1).Value = 4 Not MacroExecMode. Issue can thus be closed.
same as #i33662
invalid
SBA: Closed.