Results 1 to 4 of 4

Thread: Macros (1997)

  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Karlsruhe, Germany
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macros (1997)

    Hello,

    Does anyone have experience writing VBA macros for power point. I need to step through all elements of a presentation that have text in them and copy the text to a Word file and then back.

    Thanks,

    Ed Colaianni

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macros (1997)

    You can march through every slide, and every Shape object on every slide, checking whether the Shape object HasTextFrame. Here's some code I have used in PPT 2000; I don't recall whether PPT 97 could host a macro:
    <pre>'Visit every slide and reset all of the text boxes to black on white
    Dim aSlide As Slide, aShape As Shape
    For Each aSlide In ActivePresentation.Slides
    If aSlide.Shapes.Count > 0 Then
    For Each aShape In aSlide.Shapes
    If aShape.HasTextFrame Then
    With aShape.Fill
    .Visible = msoTrue
    .ForeColor.SchemeColor = ppBackground
    .Transparency = 0#
    .Solid
    End With
    With aShape.TextFrame.TextRange
    'Change text colors
    .Font.Color.SchemeColor = ppForeground
    'Remove any embossing
    .Font.Emboss = msoFalse
    'Recolor bullets, if any
    If .ParagraphFormat.Bullet = msoTrue Then
    .ParagraphFormat.Bullet.Font.Color.SchemeColor = ppForeground
    End If
    End With
    End If
    Next
    End If
    Next</pre>

    The part about copying to Word and then back, though, what is that about? Maybe there is a better way to do that?

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Macros (1997)

    Jefferson,

    ppt 97 does host macros and yours seemed to work on a quick test presentation. I've recorded other macros in 97.

    Fred

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macros (1997)

    <img src=/w3timages/blackline.gif width=33% height=2>
    > need to step through all elements of a presentation that have text in them and copy the text to a Word file and then back.
    <img src=/w3timages/blackline.gif width=33% height=2>

    Does post 113377 do what you want? What do you mean "and then back"? If you mean you want to edit the presentation in Word and then reconstruct it back in powerpoint, then it's easy if you just have bulleted placeholders, but it's very difficult if you have shapes, transitions, and/or animation. HTH --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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