following code can count words on each slide ( even inside table cells) and
out put with a message box. Obviously you can change the output method
Sub wordCount()
Dim osld As Slide
Dim oShp As Shape
Dim LCount As Long
For Each osld In ActivePresentation.Slides
For Each oShp In osld.Shapes
If oShp.HasTextFrame Then
If oShp.TextFrame.HasText Then
LCount = LCount + oShp.TextFrame.TextRange.Words.Count
End If
ElseIf oShp.HasTable Then
CCount = oShp.Table.Columns.Count
RCount = oShp.Table.Rows.Count
For CIndex = 1 To CCount
For RIndex = 1 To RCount
LCount = LCount + oShp.Table.Cell(RIndex, _
CIndex).Shape.TextFrame.TextRange.Words.Count
Next
Next
End If
Next oShp
MsgBox "slide : " & osld.SlideIndex & " word count : " & LCount
LCount = 0
Next osld
End Sub
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.