How to set Color RGB of specific letter by value calc?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
countervector
Posts: 7
Joined: Thu Sep 30, 2021 10:37 pm

How to set Color RGB of specific letter by value calc?

Post by countervector »

Hi, How I do that?
For Example, I have value called "4" in the `A1` Cell I need to set color Blue or like this:

Code: Select all

oCell.LetterColor.RGB(0,0,100)
Last edited by robleyd on Wed Oct 27, 2021 1:06 pm, edited 1 time in total.
Reason: Remove Known Issue icon
OpenOffice 4.1.3
Windows 10
User avatar
Zizi64
Volunteer
Posts: 11363
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to set Color RGB of specific letter by value calc?

Post by Zizi64 »

Use the Styles instead of the direct (manual) formatting method.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to set Color RGB of specific letter by value calc?

Post by Villeroy »

Conditional formatting is the feature which formats cells based on conditions based on formula expressions. There is also a STYLE function.
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
countervector
Posts: 7
Joined: Thu Sep 30, 2021 10:37 pm

Re: How to set Color RGB of specific letter by value calc?

Post by countervector »

Please give me a small fragment of code (macro), need certainly RGB methode, but not a style methode, please help me.
OpenOffice 4.1.3
Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to set Color RGB of specific letter by value calc?

Post by Villeroy »

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
Zizi64
Volunteer
Posts: 11363
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to set Color RGB of specific letter by value calc?

Post by Zizi64 »

First download, install, study and use one of the excellent Object inspection tools: the MRI or the XrayTool.

Then you will able to examine the programming objects by listing theit properties, methods and interfaces.

Code: Select all

oCell = ... (get the cell what you want to examine)
REM: examine the object oCell:
xray oCell
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply