[Base] different words color in a textbox control?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

[Base] different words color in a textbox control?

Post by arfgh »

is there a way to achieve different words colors in textfile in a form document in BASE ?
i was trying with the api createTextCursor() without lucky. All that i can achieve is to change the whole control text color..

maybe is not possible ?

Code: Select all

		Content = form.getByName( "textcontrol" )
		Curs = content.createTextCursor()
		Curs.goRight(11, True)
		Curs.CharColor = RGB(256, 128, 64)
		Curs.gotoEnd(true)
		Curs.charcolor = RGB(255, 0, 0)
Last edited by arfgh on Sun Mar 19, 2023 5:39 pm, edited 1 time in total.
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Base] different words color in a textfield?

Post by JeJe »

Do you mean a form controls text box in which you've set the Control's text type to Multi-line with formatting?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Re: [Base] different words color in a textfield?

Post by arfgh »

i mean some way to achieve different lines color and/or different words color, if possible.
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Base] different words color in a textfield?

Post by JeJe »

I get that... you talk about a textfield, a textfile, and a control... three different things... which is it?

Edit: If its a control, have you set it to with Multi-line with formatting and explored its text with MRI?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Re: [Base] different words color in a textfield?

Post by arfgh »

It a database form with a textbox control.
yes, multiline on it. But there i see the problem because if i set multiline with formating text, i lost the datasource from DB, the tab to configure the datasource is not appearing. And like i said, i want to achieve this in a database form document. Maybe i am not understanding that multine with formating text.. or, i dont know.
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
UnklDonald418
Volunteer
Posts: 1544
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: [Base] different words color in a textbox control?

Post by UnklDonald418 »

I saw the old thread you bumped
How do I use "Multi-Line with Formatting" in a Base Form?
but since it is locked I am responding here.
Here is an old discussion on this topic Multiline with formatting
Neither the HSQL back end nor the Base front end actually support formatted text.
You could save your formatted text in .odt files and store links to them in your database, similar to the way images are often handled. You would need a small macro to open the URL in Writer.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Re: [Base] different words color in a textbox control?

Post by arfgh »

thx so much friend, i will take a look to that, we will see :)
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
Post Reply