[Calc] Get Macro-Editor open fast with 1 button
Posted: Thu Sep 18, 2008 9:07 pm
To speed up opening the macro-editor with clicking on 1 button.
Because I get to many error-loops where I need to terminate OO with ctrl-alt-del and to get back to programming fast.
Because I get to many error-loops where I need to terminate OO with ctrl-alt-del and to get back to programming fast.

Code: Select all
sub sOpenMacroEditor 'Assigned to a button to speed up opening the macro editor in this code.
dim aOptions(5) as New com.sun.star.beans.PropertyValue
'Name of library
aOptions(0).Name="LibName" : aOptions(0).Value="Standard"
'Name from Module or Dialog
aOptions(1).Name="Name" : aOptions(1).Value="Module1"
'Linenumber to set the cursor.
aOptions(2).Name="Line" : aOptions(2).Value=300
'NOTE: I which I could go to the last cursor or a marker like a special word :?:
'Module or Dialog
aOptions(3).Name="Type" : aOptions(3).Value="Module"
'Split full path\filename into an array
aTemp=split(ConvertFromURL(ThisComponent.GetURL),"\")
'Get filename from the last array used and remove the extention
aTemp=split(aTemp(uBound(aTemp)),".")
'Name of the document = filename without extention
aOptions(4).Name="Document" : aOptions(4).Value=aTemp(0)
oFrame = CreateUnoService("com.sun.star.frame.Frame")
oDispatchHelper = createUnoService("com.sun.star.frame.DispatchHelper")
oTemp = oDispatchHelper.ExecuteDispatch(oFrame, ".uno:BasicIDEAppear" ,"" ,0 ,aOptions())
end sub