I have a .docx document that I downloaded from a friend’s Google Drive. There aren’t any styles, so I want to find all text of various formats and then create styles from that. I have followed the directions at Text Format (Search) to try to find all text of a particular format Arial, Bold, 12pt, Single Underline, Black, and so on, trying to replicate in the Find and Replace Format dialog whatever I see in the Format Character dialog for some selected text. I also have the Include Styles box checked. However, no matter what I try, it always says Search key not found. I thought it may be an issue with Arial not being an installed font, but when I followed the instructions at MS Core Fonts on Silverblue - #5 by pluto - Fedora Discussion and now see Arial as a selectable font, I still get Search key not found. When I copy the same document from the visual editor at LPedia.org and paste into a new Writer document, I am able to find text based on formatting, so now I’m wondering if there is some issue with .docx files.
GOOD document
lpedia_version.odt (62.1 KB)
BAD document
CO-Bylaws_2023-04-02.docx (49.1 KB)
LibreOffice 25.2.3.2 520(Build:2)
Fedora release 42 (Adams)
Here Fedora 42 with KDE Plasma, LO 25.2.4.3
As soon I mention Arial in Find & Replace, I get “no match” (Arial is not installed). If I leave the Family: field blank, matches are found. So, it could be related to non-installed font.
Nevertheless, there are strange things in the .docx: when I add Font color to the search criteria, only a part of a few headings are highlighted, meaning there is a redundant attribute formatting in the text.
OK, If I click No Format and close and reopen Find & Replace and go back into Format and leave Family blank as you did and select only Style Bold in the Font tab, and then Find All, I get 102 matches, which looks like the titles and headings. If I then select Left in the Alignment tab and Find All again, then it looks like I get all of the text used as headers (99 matches). If I then open Format > Character and look at Font Effects there, it shows nothing selected for Underline, even though as far as I can tell, all the selected text is underlined. If I add Color Black to F&R’s Format - Font Effects, then only 47 matches – parts of the headings, as you described. But when I add any kind of Underline, then it shows Search key not found, even though I can select an underlined word in the first heading and see Underlined Single when I open Format > Character
It seems like some of this is unexpected behavior, to say the least.
Default Paragraph style already defines Arial 12 pt so if I search on Underline > Single only, it should return everything underlined; it doesn’t. LibreOffice 24.2.4.2 to 25.8.0
If I open the document in LibreOffice 7.6.7.2 then it finds 118 instances of Single underline. If I search on Single underline, bold it finds the 97 instances of underlined heading.
Note: if I search on just Arial by itself it finds nothing, just the same as later versions
I suggest to report a bug with regression after 7.6.7.2, How to Report Bugs in LibreOffice - The Document Foundation Wiki
It seems to me that you might be better off to use Regular Expressions to find the different levels of Heading.
[Edit]
Also see Bug 161182 - Advanced search and replace not finding direct formatted words (character highlight) or character style with coloured font effect