I made a macro that replaces all characters in a text, from old transcription fonts to a unicode font. I don't know why, but some characters keep the original formatting, while others lose the formatting (in my case, mostly italics), often within the same word. This leaves me with a lot of words in which some letters are italicized, and other letters aren't (e.g., "al-Malik al-Muǧāhid ḫuṭba"). The characters that lose the formatting are all characters with diacritics, but not all characters with diacritics lose their formatting (e.g., the ḫ in the example).
What would be the best way to find all words that have at least one letter in italics, and apply italics formatting to all those words?
If someone could point me to a solution for the original problem, that would of course be even better (but that is the subject of another question: some characters lose formatting in vba macro others don't).
The below code answers the question of 'find all words that have at least one letter in italics, and apply italics formatting to all those words'
I've added comments to describe what is happening. I've automated Word a lot and I find it to have a lot of quirks, so the below worked in a simple test but you should test thoroughly before releasing code into the wild.
Adapted from edit request from @peterv (the OP)
To make this work in footnotes, headers and other storyranges, I adapted Gary's solution by combining it with this trick: