Hi
help me
i want change font color use basic macro in cell text
but i not want all text
just section text
example
"This is test string"
i want change "test" color
[Solved] Change color in macro
[Solved] Change color in macro
- Attachments
-
- test.png (8.7 KiB) Viewed 744 times
Last edited by Hagar Delest on Tue Mar 18, 2014 12:00 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Linux 2.6 CentOS
Openoffice 3.1.1
Openoffice 3.1.1
Re: change color in macro
If the text were in cell A1 of Sheet1
Code: Select all
oSheets = ThisComponent.getSheets()
oObj1 = oSheets.getByName("Sheet1")
oCell = oObj1.getCellRangeByName("A1")
oText = oCell.getText()
oObj2 = oText.createTextCursor()
oObj2.gotoStart(False)
oObj2.goRight(8, False)
oObj2.goRight(4, True)
oObj2.CharColor = RGB(255,0,0)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.