Hello, I'm trying to learn a bit of OObasic.
So far, I didn't find anything, even in this forum.
Does anyone have a clue how to select one shape by name in calc?
Thanks for any help.
Select shape by name
Select shape by name
broffice 3.2 on linux at work
libreoffice 4.3 on windows at home
libreoffice 4.3 on windows at home
Re: macro to select shape by name
The Drawpage of a Calc sheet doesn't have a getByName() method. You could try iterating over all the objects and testing the name, though I don't know that all possible objects will have a Name property.
Code: Select all
oSheet = ThisComponent.Sheets.getByName("Hoja1")
oDP = oSheet.Drawpage
count = oDP.Count
For i = 0 to count - 1
oItem = oDP.getByIndex(i)
If oItem.Name = "TheShape" then
print "Found it!"
end If
next i
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: macro to select shape by name
Thanks for assistance.
I already did exactly the code you wrote.
As I have lots of shapes, the program became slow until find the shape and make the necessary changes.
My hope was selecting the shape in a very direct way.
Anyhow thanks again for your response.
I already did exactly the code you wrote.
As I have lots of shapes, the program became slow until find the shape and make the necessary changes.
My hope was selecting the shape in a very direct way.
Anyhow thanks again for your response.
broffice 3.2 on linux at work
libreoffice 4.3 on windows at home
libreoffice 4.3 on windows at home