how to set a style for single words in a word document
I would like to insert single words with a specific style in a word document from a macro. Whenever I change the Style property of the Selection object or even of a range (e.g. ActiveDocument.Range(1,3)) the style of the wh开发者_如何学JAVAole paragraph is set.
How can I do this?You're trying to apply a paragraph style.
These styles can only be applied to complete paragraphs.
If you apply a character style, it will work fine.
You can simply select the word with your mouse (click&drag with the cursor) and then select the text properties such as the font, only the selected characters will change to that font.
精彩评论