Results 1 to 5 of 5

Thread: Power Point Macro (WordArt)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Unhappy 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

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Re: Power Point Macro (WordArt)

    Any Help Please

  3. #3
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    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:
    1. Sub WordArtCounter()
    2.     Dim oSlide As Slide
    3.     Dim oShape As Shape
    4.     Dim intCounter As Integer
    5.     intCounter = 0
    6.     For Each oSlide In ActivePresentation.Slides
    7.         For Each oShape In oSlide.Shapes
    8.             If oShape.Type = msoTextEffect Then
    9.                 intCounter = intCounter + 1
    10.             End If
    11.         Next
    12.     Next
    13.     MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion
    14.     MsgBox "There are " & intCounter & " Wordart(s) in this presentation", vbQuestion
    15. End Sub
    Hope this helps!
    CS

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    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:
    1. Sub WordArtCounter()
    2.     Dim oSlide As Slide
    3.     Dim oShape As Shape
    4.     Dim intCounter As Integer
    5.     intCounter = 0
    6.     For Each oSlide In ActivePresentation.Slides
    7.         For Each oShape In oSlide.Shapes
    8.             If oShape.Type = msoTextEffect Then
    9.                 intCounter = intCounter + 1
    10.             End If
    11.         Next
    12.     Next
    13.     MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion
    14.     MsgBox "There are " & intCounter & " Wordart(s) in this presentation", vbQuestion
    15. End Sub
    Hope this helps!
    It worked great thanks a lot man.

  5. #5
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Power Point Macro (WordArt)

    You are Welcome!

    Please use [vbcode] your code goes in here [/vbcode] tags when posting code.
    CS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width