Power Point Macro (WordArt)
Hello, this code was suppose to count WordArt only but it also counts picture how do I just do WordArt count not picture and picture count by itself thanks.
Sub Counter()
Dim WordArt As Integer
Dim Counter As Integer
Dim Slide As Integer
Counter = 0
With PowerPoint.ActivePresentation
For Slide = 1 To .Slides.Count
For WordArt = 1 To .Slides(Slide).Shapes.Count
If .Slides(Slide).Shapes(WordArt).AutoShapeType = -2 Then
Counter = Counter + 1
End If
Next WordArt
Next Slide
End With
MsgBox "There are " & Slide - 1 & " Slide(s) in this presentation", vbQuestion
MsgBox "There are " & Counter & " Wordart(s) in this presentation", vbQuestion
Save.Show
End Sub
Re: Power Point Macro (WordArt)
Re: Power Point Macro (WordArt)
Welcome to Forums!
Please use [vbcode] your code goes in here [/vbcode] tags when posting code.
Here is the code to count number of word arts in a powerpoint file:
VB Code:
Sub WordArtCounter()
Dim oSlide As Slide
Dim oShape As Shape
Dim intCounter As Integer
intCounter = 0
For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Type = msoTextEffect Then
intCounter = intCounter + 1
End If
Next
Next
MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion
MsgBox "There are " & intCounter & " Wordart(s) in this presentation", vbQuestion
End Sub
Hope this helps!
Re: Power Point Macro (WordArt)
Quote:
Originally Posted by cssriraman
Welcome to Forums!
Please use [vbcode] your code goes in here [/vbcode] tags when posting code.
Here is the code to count number of word arts in a powerpoint file:
VB Code:
Sub WordArtCounter()
Dim oSlide As Slide
Dim oShape As Shape
Dim intCounter As Integer
intCounter = 0
For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Type = msoTextEffect Then
intCounter = intCounter + 1
End If
Next
Next
MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion
MsgBox "There are " & intCounter & " Wordart(s) in this presentation", vbQuestion
End Sub
Hope this helps!
It worked great thanks a lot man. :wave:
Re: Power Point Macro (WordArt)
You are Welcome!
Please use [vbcode] your code goes in here [/vbcode] tags when posting code.