Sub P
Dim PPP As Object
ppp = ThisComponent.beans.getPropertyByName()
Print ppp
End Sub
Print is command that prints a string. I need to extract from ThisComponent all available values but I have no idea how. Though I need a service of getPropertyValue() but before that I have to know what module I am in. The code above errors with "Property or method not found :beans." How to see into ThisComponent?
I rewrite the code
Sub P
Dim oPPP As Object
Dim sPPP As String
oPPP = ThisComponent
sPPP = oPPP.getPropertyByName()
Print " " & sPPP
End Sub
The code errors with "Property or method not found :getPropertyByName()"
[Solved] What modules are in ThisComponent
-
- Posts: 15
- Joined: Sat Jun 24, 2023 2:42 pm
[Solved] What modules are in ThisComponent
Last edited by no_such_UNO on Sat Jun 24, 2023 5:26 pm, edited 1 time in total.
LibreOffice 7.2.7.3 on LinuxMint 21.1
Re: What modules are in ThisComponent
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 15
- Joined: Sat Jun 24, 2023 2:42 pm
Re: What modules are in ThisComponent
Thank you JeJe for your prompt reply but the beast is written in Python. I do need to learn Python then and I would appreciate something written in Basic as I am new to it and it is more natural to the office suit, at least it is my opinion.
LibreOffice 7.2.7.3 on LinuxMint 21.1
Re: What modules are in ThisComponent
The language does not matter at all. MRI can even generate Basic code (or Java or C++ or Python).
[Tutorial] Introduction into object inspection with MRI
[Tutorial] Introduction into object inspection with MRI
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
- MrProgrammer
- Moderator
- Posts: 4909
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: [Solved] What modules are in ThisComponent
OpenOffice Help wrote:ThisComponent [Runtime]
Addresses the active component so that its properties can be read and set. ThisComponent is used from document Basic, where it represents the document the Basic belongs to. The type of object accessed by ThisComponent depends on the document type.
Tools → Macros → Organize Macros → OpenOffice Basicno_such_UNO wrote: ↑Sat Jun 24, 2023 4:29 pm I need to extract from ThisComponent all available values but I have no idea how.
I would appreciate something written in Basic.
WritedbgInfo(ThisComponent)
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
-
- Posts: 15
- Joined: Sat Jun 24, 2023 2:42 pm
Re: [Solved] What modules are in ThisComponent
MrProgrammer it s tough! But how to use these macros? No relevant manual I can find. And yet this is buggy
But my wish is fulfilled. Thank you.
Sub SetBasicReadOnlyFlag(bReadOnly as Boolean) Dim i as Integer Dim LibName as String Dim BasicLibNames() as String BasicLibNames() = BasicLibraries.ElementNames() For i = 0 To Ubound(BasicLibNames()) LibName = BasicLibNames(i) If LibName <> "Standard" Then BasicLibraries.SetLibraryReadOnly(LibName, bReadOnly) <<arguments is not optional End If Next i End Sub
But my wish is fulfilled. Thank you.
Edit: But how to use these macros? is a new subject and would need a new topic. The current topic concerns ThisComponent. -- MrProgrammer, forum moderator |
Last edited by MrProgrammer on Thu Jun 29, 2023 4:05 pm, edited 2 times in total.
Reason: Add fomatting tags
Reason: Add fomatting tags
LibreOffice 7.2.7.3 on LinuxMint 21.1