![]() |
#1
|
|||
|
|||
![]()
I'm trying to apply a style to the next paragraph after changing the preceding one, but I get an error. Can someone help? Thanks!
Code:
Dim oPar As Paragraph For Each oPar In ActiveDocument.Paragraphs If oPar.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Then oPar.Range.Style = "MyStyle1" ' oPar.Next.Style = "MyStyle2" '---> I get an error End If Next oPar |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to apply a style to a group of words inside a paragraph? | saint—112 | Word | 3 | 09-07-2022 09:55 PM |
Apply table style | shahid.majeed | Word Tables | 0 | 10-02-2019 01:25 AM |
My style keeps changing, can't get saved style to apply | Meenie50 | Word | 7 | 07-20-2017 03:47 PM |
Paragraph space before - can styles apply it intelligently? | timpani | Word | 7 | 10-23-2012 04:08 PM |
Character style stripped while applying paragraph style | sams_gates | Word | 0 | 08-29-2009 02:03 AM |