Defining and applying styles in code

D

Davey

Hello

I'm try to define a style that will take text from a range variable. I want
to change the color to red, bold the text, underline it, and indent the text
before inserting it after the paragraph in another document. My question is
how do I define a style in code and apply it when I need to?

Currently I'm doing this:
If rSynopsis.Text Like "bodybuilding*" Then
.Collapse direction:=wdCollapseEnd
.InsertParagraphAfter
.Bold = True
.Font.Color = wdColorRed
.Font.Underline = wdUnderlineNone
.Text = vbTab & rSynopsis.Text
end if

This causes numbering or bullets to be placed after my inserted paragraph.
I've used styles in the word interface but I've never dealt with them in
code. Is defining and applying styles a daunting task?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top