[Solved] "OpenMacroEditor" doesn't work after OO-update !?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
onidarbe
Posts: 84
Joined: Thu Nov 29, 2007 8:03 pm
Location: Belgium, Mechelen

[Solved] "OpenMacroEditor" doesn't work after OO-update !?

Post by onidarbe »

Hi,
I had a very nice macro assigned to a toolbar-button to open my OO-basic macro 'Module1' in 1 click.
Now after updating OO 2.4 to 3.0.1 it doesn't work anymore :(
It opens the macro editor, but not Module1.

Does anyone know why?

Code: Select all

sub sOpenMacroEditor 'Assigned to a button to speed up opening the macro editor in this code.
   'to assign it to a button: ooCalc/Tools/Customize/ToolBars/Add.../OpenOffice.org Macros/ThisFilename/Standard/Module1/sOpenMacroEditor/Add
   dim aOptions(5) as New com.sun.star.beans.PropertyValue
   aOptions(0).Name="LibName": aOptions(0).Value="Standard"   'Name of library
   aOptions(1).Name="Name": aOptions(1).Value="Module1"   'Name from Module or Dialog
   aOptions(2).Name="Line": aOptions(2).Value=440   'Linenumber to set the cursor. NOTE: I which I could go to the last cursor or a marker...
   aOptions(3).Name="Type": aOptions(3).Value="Module"   'Module or Dialog
   aTemp=split(ConvertFromURL(ThisComponent.GetURL),"\")
   aTemp=split(aTemp(uBound(aTemp)),".")   'Get filename
   aOptions(4).Name="Document": aOptions(4).Value=aTemp(0)   'Name of the document = filename without extention
   oFrame = CreateUnoService("com.sun.star.frame.Frame")
   oDispatchHelper = createUnoService("com.sun.star.frame.DispatchHelper")
   oTemp = oDispatchHelper.ExecuteDispatch(oFrame, ".uno:BasicIDEAppear" ,"" ,0 ,aOptions())
end sub
Last edited by Hagar Delest on Sun Feb 08, 2009 4:37 pm, edited 2 times in total.
Reason: Tagged as [Solved]
OOo 3.1.X on Ms Windows XP
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: "OpenMacroEditor" doesn't work after OO-update !?

Post by B Marcelly »

Hi,
I have also discovered that this trick does not work any more.
If I remember correctly, it is because the name of the window title of the Basic IDE has changed.
So this dispatch option is useless because it depends on OOo version.
______
Bernard
User avatar
onidarbe
Posts: 84
Joined: Thu Nov 29, 2007 8:03 pm
Location: Belgium, Mechelen

Re: "OpenMacroEditor" doesn't work after OO-update !?

Post by onidarbe »

As long as there isn't an other solution to go quickly to the programcode, it's not entirely useless. Because you only need it in development of the total code.

Question now is how to solve it now for this 00-version...
OOo 3.1.X on Ms Windows XP
User avatar
onidarbe
Posts: 84
Joined: Thu Nov 29, 2007 8:03 pm
Location: Belgium, Mechelen

Re: "OpenMacroEditor" doesn't work after OO-update !?

Post by onidarbe »

One could just make a program error to open the macro-editor and get to that line.
Assign a button to that sub with an error in it:
ooCalc/Tools/Customize/ToolBars/Add.../OpenOffice.org Macros/ThisFilename/Standard/Module1/sOpenMacroEditorHere/Add

Code: Select all

sub sOpenMacroEditorHere 'Assigned to a button to speed up opening the macro editor in this code.
   thisComponent.makeError
end sub
OOo 3.1.X on Ms Windows XP
bharatsatyal
Posts: 2
Joined: Wed Feb 11, 2009 5:57 am

Can't we use VbScript macro in open office in linux platform

Post by bharatsatyal »

Hi,
I was using windows and migrated to Ubuntu. Now i want to use macros of excel in open office spreadsheet but I could not use. The macro was written in VbScript. Can anyone help me to resolve this problem.
Thank you
OOo 2.4.X on Ubuntu 8.x
Post Reply