![]() |
|
#4
|
|||
|
|||
|
Hi, Gmaxey! I tried this code of yours on its own and it produces an error: Object variable or With block variable not set. Please help. Thanks!
Code:
Sub Unnumbered()
Dim oPar As Paragraph
Dim oRng As Range
For Each oPar In oRng.Paragraphs
If oPar.Range.ComputeStatistics(wdStatisticLines) = 1 _
And oPar.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft _
And Not oPar.Range Like "*[0-9]*" Then
oPar.Range.Style = "Mystyle"
End If
Next oPar
End Sub
UPDATE: I managed to amend with: For Each oPar In ActiveDocument.Paragraphs |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Assign different heading styles for different paragraphs
|
Thorin23 | Word VBA | 3 | 05-02-2021 06:22 AM |
| Formatting all paragraphs based on pre defined styles | afif | Word VBA | 0 | 07-26-2019 06:18 AM |
Make paragraphs appear according to specific combination
|
razdul | Word VBA | 2 | 04-17-2019 06:17 AM |
| Trouble Formatting Specific Paragraphs - Bullets, Spacing, Centering, etc | adzialo | Word | 2 | 05-01-2017 12:53 PM |
Selection of all Text for a specific page in word is spanning selection across pages
|
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |