I am working a routine that will check the style of each paragraph in a document. I am experimenting with the following code, but the variable just is not quite right. The code drops to the case else statement.
Any ideas?
Thanks,
Oscar
Code:
Sub CheckStyle()
Dim mPara As Paragraph
For Each mPara In ActiveDocument.Paragraphs
SelectWhat = mPara.Style 'mPara.Format.Style.NameLocal
Select Case SelectWhat
Case SelectWhat = "AHead" ' must have the styles named in the document
MsgBox "Yes this is good" & SelectWhat
Case SelectWhat = "AlphaList"
MsgBox "Yes this is good" & SelectWhat
Case SelectWhat = "BHead"
MsgBox "Yes this is good" & SelectWhat
Case SelectWhat = "Body Text"
MsgBox "Yes this is good" & SelectWhat
'...
Case Else
Debug.Print "Case Else" & SelectWhat
End Select
Next
End Sub
Thanks,
Oscar