Formating bolded text exclusively.

Sep 30, 2021
Reaction score
Hello! I've been coding VBA exclusively in Excel, but I know zero of its applications for Word.
I have tried solving the following problem, until now with very little success.
I have text sections in which a few words are bolded. The bolded words depend on the searched category.
For example, if I want to check fruits, and just fruits will already be bolded in the middle of the text (Solutions already in place).
Now with this text section needs further processing.

///Raw text example:
Request ref#14587** include Banana, celery, bread, melon, base, bulb, Cucumber, grapes chocolate,
cheese mango, mango cat food, carrot,

and others several listed in subsequent ref.
//Final text:
Request ref#14587** include BANANA, celery, bread, MELON, base, bulb, Cucumber, GRAPES chocolate, cheese MANGO, MANGO cat food, carrot, MELON, and others several listed in subsequent ref.

Actions required:
1-To use only the selected text section as the range so it doesn't affect other text sections in the doccument;
2-Trim spaces, including not leaving a space at the end of the sentences;
3-Remove paragraphs if existing;
4-Uppercase all bolded characters
5-List the bolded words after the selected text section, separated by a comma "," and remove duplicates just from this created text section;
6-Unbold the initially selected text, and the created text section.

Is this possible? Or am I being too ambitious?
Can someone please advise?