PDA

Click to See Complete Forum and Search --> : Power Point Macro (WordArt)


Kawser
Apr 7th, 2006, 02:13 PM
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

Kawser
Apr 8th, 2006, 06:44 PM
Any Help Please

cssriraman
Apr 8th, 2006, 09:13 PM
Welcome to Forums!

Please use your code goes in here tags when posting code.

Here is the code to count number of word arts in a powerpoint file: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 SubHope this helps!

Kawser
Apr 10th, 2006, 11:27 AM
Welcome to Forums!

Please use your code goes in here tags when posting code.

Here is the code to count number of word arts in a powerpoint file: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 SubHope this helps!

It worked great thanks a lot man. :wave:

cssriraman
Apr 10th, 2006, 12:30 PM
You are Welcome!

Please use your code goes in here tags when posting code.