2011/8/14 Johnny Rosenberg <gurus.knu...@gmail.com>: > 2011/8/14 Johnny Rosenberg <gurus.knu...@gmail.com>: >> 2011/8/14 Johnny Rosenberg <gurus.knu...@gmail.com>: >>> 2011/8/14 Oliver Brinzing <oliver.brinz...@gmx.de>: >>>> Hi Johnny, >>>> >>>>> If I only can read all the text in one module at once, that would do >>>>> it just fine. If there is a simple one-liner that reads just one >>>>> function or subroutine, that's a bonus, and if I can read a dialogue >>>>> that's even better… >>>> >>>> Have you tried: >>>> >>>> Sub Test() >>>> >>>> Dim oLibs as Object >>>> Dim oLib as Object >>>> Dim sLib as String >>>> >>>> Dim mTmp() >>>> Dim i as Integer >>>> Dim s as String >>>> >>>> sLib = "Standard" >>>> oLibs = GlobalScope.BasicLibraries >>>> If Not oLibs.hasByName(sLib) Then >>>> MsgBox "Error reading " & sLib >>>> EndIf >>>> >>>> oLib = oLibs.getByName(sLib) >>>> >>>> mTmp() = oLib.getElementNames() >>>> >>>> For i = 0 To uBound(mTmp()) >>>> s = s + mTmp(i) & Chr(13) >>>> Next i >>>> MsgBox s >>>> >>>> MsgBox oLib.getByName(mTmp(0)) >>>> >>>> End Sub >>> >>> No, I didn't, but it seems to work for my global macros. I guess I >>> need to change the ”oLibs = GlobalScope.BasicLibraries” line for local >>> code (macros for the current document only), but to what? >>> >>> >>> Regards >>> >>> Johnny Rosenberg >>> ジョニー・ローゼンバーグ >>> >>>> Regards >>>> Oliver >>> >> >> Experimented a bit: >> Sub Main >> Dim A As String >> >> ' Getting code from the tab ”Spel” in the current document: >> A=ThisComponent.BasicLibraries.getByName("Standard").getByName("Spel") >> MsgBox A >> End Sub >> >> Thanks for your hint! >> >> >> Kind regards >> >> Johnny Rosenberg >> ジョニー・ローゼンバーグ >> > > Also tried with Dialogues, but (in my case, as an example) > ThisComponent.DialogLibraries.getByName("Standard").getByName("Namndialog"), > which is a simple dialogue, seems to be an object of some kind and > it's not very obvious how to get the information I need from it (like > labels names of buttons and other objects, which macro they call and > so on). I guess I have to study it a bit closer, but all shortcuts > (like if someone would like to provide an example of some kind or > something) are welcome… > > After having studied it only for maybe a minute or so, it seems like I > need to know what I'm looking for to look for it… But studying it more > might give me another impression of the whole thing, I don't know.
I think I have it now. I have to create a UNO dialogue first, then I can get my info from it. I think the following code will give me every information I want from one of my dialogues: Sub main Dim X As Object X=CreateUnoDialog(DialogLibraries.getByName("Standard").getByName("Resultatdialog")) Xray X End Sub Kind regards Johnny Rosenberg ジョニー・ローゼンバーグ -- ----------------------------------------------------------------- To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help