[Solved] How to get alternative text of object?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Evgeniy
Posts: 43
Joined: Thu Jan 09, 2020 9:31 pm
Location: Russia

[Solved] How to get alternative text of object?

Post by Evgeniy »

How to get alternative text of object in Basic?
Image
Last edited by Evgeniy on Tue Jan 21, 2020 5:11 am, edited 2 times in total.
OpenOffice 4.1.7 OS: Win10 x32 + Win10 x64
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to get alternative text of object?

Post by FJCC »

Strangely, that text is the Title property. If I enter something in that box labeled Alternative (Text Only), I can print it out with the following code. (My document only has one picture)

Code: Select all

oDP = ThisComponent.DrawPage
oObj = oDP.getByIndex(0)
print oObj.Title
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.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to get alternative text of object?

Post by Villeroy »

I enter "foooo" as alternative text and select the shape.
menu:Tools>Add-ins>Mri <-- Selection
I select the properties tab and do a search for "foooo" in the little search box.

Code: Select all

Title                         string                         Fooooo
It is the "Title" property.
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
User avatar
Evgeniy
Posts: 43
Joined: Thu Jan 09, 2020 9:31 pm
Location: Russia

Re: How to get alternative text of object?

Post by Evgeniy »

Tnanks. I could not think that this is "Title" property.
OpenOffice 4.1.7 OS: Win10 x32 + Win10 x64
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] How to get alternative text of object?

Post by Villeroy »

Evgeniy wrote:Tnanks. I could not think that this is "Title" property.
That's why I looked it up.
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
Post Reply