[Writer] Set font color to all matching regex ?
-
- Posts: 91
- Joined: Sat Jan 04, 2014 1:28 pm
[Writer] Set font color to all matching regex ?
should be something/or not along createReplaceDescriptor , but can't find anything ...
OPen office 4.1.5/ win 7
Re: macro - set font color to all matching regex ?
There's an example of setting the search attributes in Useful Macro Information For OpenOffice By Andrew Pitonyak
Edit:
And replace attributes.
You could also use the macro record to get a solution.
Edit:
And replace attributes.
You could also use the macro record to get a solution.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: macro - set font color to all matching regex ?
menu:Edit>FInd&Replace...
do the regex search and hit [Find All]
Apply a prepared character style or some formatting attribute.
do the regex search and hit [Find All]
Apply a prepared character style or some formatting attribute.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: macro - set font color to all matching regex ?
Look here
viewtopic.php?f=20&t=104271
viewtopic.php?f=20&t=104271
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community
-
- Posts: 91
- Joined: Sat Jan 04, 2014 1:28 pm
Re: macro - set font color to all matching regex ?
How to undo 'find all', I mean text stays selected, don't want that.Villeroy wrote:menu:Edit>FInd&Replace...
do the regex search and hit [Find All]
Apply a prepared character style or some formatting attribute.
Click somewhere does it, but this is part of macro so it should be automatic. There is no edit/'unselect all'.
OPen office 4.1.5/ win 7
Re: macro - set font color to all matching regex ?
Store the selection before you do whatever operation than select it again afterwards.
Code: Select all
vc = Thiscomponent.currentcontroller.viewcursor
tc = vc.text.createtextcursorbyrange(vc)
'... do whatever
thiscomponent.currentcontroller.select(tc)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)