2011/8/14 Johnny Rosenberg <[email protected]>:
> 2011/8/14 Oliver Brinzing <[email protected]>:
>> 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
ジョニー・ローゼンバーグ
--
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help