jc79
02-14-2013, 06:31 AM
I'm trying to create a macro that formats the selection with a strikethrough and bold, then inserts text before and after the selection with bold text. Below is the macro I've started:
Selection.Font.StrikeThrough = True
Selection.InsertBefore "<D>"
Selection.InsertAfter "<D>"
Selection.Font.bold = True
The output looks something like this, although I can't find a strikethrough font option in the post editor so have underlined it instead:
<D>text goes here<D>
This macro sometimes works :dunno
If my selection includes the space after the last word, it will format the way I want it to. But if I don't select the space after the last word, the second <D> retains the formatting of the original selection. The first <D> is never affected.
I think this has something to do with how Word retains character-level formatting but I can't seem to figure it out. Any assistance would be greatly appreciated.
Selection.Font.StrikeThrough = True
Selection.InsertBefore "<D>"
Selection.InsertAfter "<D>"
Selection.Font.bold = True
The output looks something like this, although I can't find a strikethrough font option in the post editor so have underlined it instead:
<D>text goes here<D>
This macro sometimes works :dunno
If my selection includes the space after the last word, it will format the way I want it to. But if I don't select the space after the last word, the second <D> retains the formatting of the original selection. The first <D> is never affected.
I think this has something to do with how Word retains character-level formatting but I can't seem to figure it out. Any assistance would be greatly appreciated.