Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I modify a paragraph style in VBA?
I'm writing a VBA macro.
In the macro, I've added a new style. Now I'd like to add formatting information to this style. How do I do this in VBA? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I modify a paragraph style in VBA?
HHM wrote:
I'm writing a VBA macro. In the macro, I've added a new style. Now I'd like to add formatting information to this style. How do I do this in VBA? Here's some sample code: Sub demo() Dim myStyle As Style Set myStyle = ActiveDocument.Styles.Add( _ Name:="NewStyle", Type:=wdStyleTypeParagraph) With myStyle .ParagraphFormat.SpaceAfter = 6 .ParagraphFormat.Alignment = wdAlignParagraphJustify .NextParagraphStyle = ActiveDocument.Styles("Normal") .Font.Name = "Arial" .Font.Bold = True .Font.Size = 14 End With End Sub If you need more help, it would be appropriate to ask in the vba.beginners group (http://www.microsoft.com/communities...a.beginner s). -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do you modify a custom style set? Style Short cut keys don't w | Microsoft Word Help | |||
Modify Footnote Style | Page Layout | |||
Modify table of contents to include headings from a paragraph | Microsoft Word Help | |||
Modify paragraph but all with same style is modified (not wanted) | Microsoft Word Help | |||
Modify style with picture | Page Layout |