Hi,
I have a 5000 line basic module in StarOffice 8 Calc (PU10) which I have been tasked with modifying. The module contains some 30 macros, many of which have been recorded.
Does anyone know if it is possible to write a macro to scan through a module, find key words like Sub or Function and extract text to a Calc or Writer document?
I've had a quick search on the forum for documenting macros, and a hunt through the developers guide and basic documents but either have missed this or am not using the correct language to search for.
In versions of Microsoft Office I have written code to extract text from an Excel VBA module, but obviously the object model is very different to StarOffice VB.
It will not take me long to manually document the macros but if there is an easier way of doing it, it'd be good to know.
Thanks for any pointers.
Mark
[Solved] Macro to document macros
[Solved] Macro to document macros
Last edited by frozbie on Fri Sep 19, 2008 1:37 pm, edited 1 time in total.
Re: Macro to document macros
maybe this extension could help:
OOo BasicTextListe2
Problem solved? Edit your first post and add "[Solved]" to the subject. Thanks.
OOo BasicTextListe2
Download, install (by double-clicking or from Tools>Extension Manager...>Add) then execute BasicTextListe2 within module BTL2 in library BTL2BTL2 wrote:Macro to list the text of all Basic modules of all installed libraries to a writer document.
This version creates a 1000 page writer document in approx. 6 seconds, including a table of content, header and footer.
Document formatted depending on OOo's GUI language used: paper format "Letter" (if English is detected), otherwise German A4 format is used. ToC, page headers and footers presentation according to language.
Problem solved? Edit your first post and add "[Solved]" to the subject. Thanks.
Re: Macro to document macros
Probe1,
That is a really useful extension (and not knowing about extensions before, I'll add the extensions library to my list of places to search in future.)
This seems to do the same job and suggests similar functionality to Microsofts VBA. I'll need to play around with the macro but this is what I needed. Thank you!
Regards
Mark
That is a really useful extension (and not knowing about extensions before, I'll add the extensions library to my list of places to search in future.)
This seems to do the same job and suggests similar functionality to Microsofts VBA. I'll need to play around with the macro but this is what I needed. Thank you!
Regards
Mark
Re: [Solved] Macro to document macros
For the readers who think if there could be more than Basic.
Change to my macro directory (Linux)
BasicDialogs.py is the name of a module.
Another one:
OK, it seems I have not written so much documentation into my modules. But I get all classes, methods with arguments, constants and so called doc-strings which can be attached to Python objects.
Change to my macro directory (Linux)
Code: Select all
$ cd ~/.openoffice.org2/user/Scripts/python]
$ python
> help()
Welcome to Python 2.5! This is the online help utility.
[...]
help> BasicDialogs
Code: Select all
Help on module BasicDialogs:
NAME
BasicDialogs
FILE
/home/andreas/.openoffice.org2/user/Scripts/python/BasicDialogs.py
CLASSES
Office
class Office
| Frequently used methods in office context
|
| Methods defined here:
|
| __init__(self, ctx=pyuno object (com.sun.star.uno.XComponentContext...sun.star.uno.XWeak,com.sun.star.lang.XComponent}})
|
| createUnoService(self, service)
|
| getCurrentComponent(self)
|
| getCurrentController(self)
|
| getCurrentFrame(self)
|
| getDesktop(self)
FUNCTIONS
getBasicDialogResult(sLibName, sDlgName)
show_Basic_Standard_Dialog1(*arg)
DATA
:
Code: Select all
help> CalcMacros
Help on module CalcMacros:
NAME
CalcMacros
FILE
/home/andreas/.openoffice.org2/user/Scripts/python/CalcMacros.py
FUNCTIONS
NowToActiveCell()
Let a formula put the current time into the active cell,
independent from language or null-date before converting to value.
No formatting intended. Apply any date/time formatting you like.
copyDownIntoSelections()
copyUpIntoSelections()
copyVisibles_Down(*args)
copyVisibles_ToLeft(*args)
copyVisibles_ToRight(*args)
copyVisibles_Up(*args)
dispatch_InputMode(oCtrl)
getActiveCell(oView)
Desparately missing in API. We extract from view data.
getActiveSheetsRangesSelection(oDoc)
getCurrentArray(oCell)
:
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice