May 24 2022 09:15 AM - edited May 25 2022 08:26 AM
Hi, I use a character style to highlight some special expressions in my document. Now I want to have quotation marks around these expressions. One convenient way to do it would be to ask the style to add the quotation marks. Is that possible?
May 25 2022 03:39 PM
Solution@mparento While you cannot include the quotation marks as part of the style, using a macro such as the following, you could have the style specified in the macro applied to the selected text and have quotation marks inserted before and after it
Set rng = Selection.Range
With rng
.Style = "Strong"
.InsertBefore Chr(34)
.InsertAfter Chr(34)
End With
May 26 2022 06:27 AM - edited May 26 2022 06:35 AM
Thanks Doug for the good idea! I was hoping to do it with the style itself. That way, if I change my mind, I could modify the style and update the whole document. With the macro, I assume that I would have to run it on each occurrence to add/remove the quotation marks. That being said, I may find you suggestion very helpful in other situations.
Addendum: thinking about it a bit more, I may use your suggestion in the present case. It would make it easier to add the quotation marks. Thanks again!