Word 2007 Macro vba issue

adriana

New member
Joined
Oct 4, 2012
Messages
3
Reaction score
0
Points
0
hi all,

quick question. can anyone have a look over the code below and tell me why it's not changing the style in every paragraph of the document.
Sub CheckMyStyles3()
MsgBox Selection.Paragraphs.Style.ListLevelNumber
Application.ScreenUpdating = False
Dim oPara As Paragraph
Dim Para As Integer
Para = Selection.Paragraphs.Style.ListLevelNumber
With ActiveDocument
For Each oPara In ActiveDocument.Paragraphs
Select Case Para
Case 1
Selection.Paragraphs.Style = "Level 1"
Case 2
Selection.Paragraphs.Style = "Level 2"
Case 3
Selection.Paragraphs.Style = "Level 3"
Case 4
Selection.Paragraphs.Style = "Level 4"
Case 5
Selection.Paragraphs.Style = "Level 5"
End Select
Next oPara
End With
End Sub


thanks!!!
:)
 
Back
Top