How to VBA to next slide in PP work area?

G

Guest

I've recorded a VBA macro that does a few things to a placeholder on a slide
in the PP work area. The macro works fine. I want to use this macro on more
than one slide, however. Unfortunetly, the VBA macro recorder will not
record a PAGE-DOWN key or a next-slide mouse click. Is there a VBA "next
slide" statement that I can insert into the VBA macro myself? I'd appreciate
any help.

Thanks.
 
G

Guest

Hi Jake

Post up what you want to do to each placeholder and whether you need to
differentiate between title , text, & other placeholders and I'll write the
code and explain how it works!
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
B

Bill Dilworth

Hey Jake,

Try adding this to your code to cycle thru each of the slides and each of
the placeholders on those slides.

====Begin Code=====
Sub RunningInPlace()

Dim oSld As Slide
Dim oShp As Shape

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes.Placeholders
'Test for placeholder type and
'Do your stuff
Next oShp
Next oSld

End Sub
=====End Code=====

From your post, it seems like you know VBA well enough to insert this, but
if you have any questions, please post back.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
G

Guest

Thanks John and Bill,

As for what I'm attempting, I want to step thru all of the Title and Text
type slides and UN-shadow all of the text within the Text Placeholder. That
is, I was trying to record a simple TAB, TAB, UN-SHADOW, PAGE-DOWN macro.

I've written a bit of VB code in the distant past but I am rusty as heck and
I'm extremely ingorant of the VBA syntax.

Bill, your code looks great but I'm unfamiliar with how to 'TEST FOR
PLACEHOLDER TYPE

Thanks again guys.
 
B

Bill Dilworth

This little code will kill shadows on most common text based placeholders.
Of course you may want to alter the types, just change the if statement to
include/exclude the placeholder type values from the table shown below.
PpPlaceholderType

Value
Constant

9
ppPlaceholderBitmap

2
ppPlaceholderBody

3
ppPlaceholderCenterTitle

8
ppPlaceholderChart

16
ppPlaceholderDate

15
ppPlaceholderFooter

14
ppPlaceholderHeader

10
ppPlaceholderMediaClip

-2
ppPlaceholderMixed

7
ppPlaceholderObject

11
ppPlaceholderOrgChart

13
ppPlaceholderSlideNumber

4
ppPlaceholderSubtitle

12
ppPlaceholderTable

1
ppPlaceholderTitle

6
ppPlaceholderVerticalBody

5
ppPlaceholderVerticalTitle





=====Begin Code=====
Sub RunningInPlace()

Dim oSld As Slide
Dim oShp As Shape

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes.Placeholders
If oShp.PlaceholderFormat.Type > 0 And _
oShp.PlaceholderFormat.Type < 5 Then
oShp.Shadow.Visible = False
oShp.TextFrame.TextRange.Font.Shadow = False
End If
Next oShp
Next oSld

End Sub
=====End Code=====

--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
G

Guest

Bill's code will unshadow both the title and text placeholders which may be
what you need This will unshadow bodytext placeholders only and ONLY on title
and text slides.

Sub shadowkill()
Dim oSld As Slide
Dim oShp As Shape
For Each oSld In ActivePresentation.Slides
If oSld.Layout = ppLayoutText Then
For Each oShp In oSld.Shapes.Placeholders
If oShp.PlaceholderFormat.Type = ppPlaceholderBody Then
oShp.TextFrame.TextRange.Font.Shadow = False
End If
Next oShp
End If
Next oSld
End Sub

If (as I suspect) you want to apply this to other text layouts e.g object &
text, title & two text then delete the line "If oSld.Layout = ppLayoutText
Then" and the second "End If"



--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
G

Guest

Thanks very much guys.

Bill, your code worked like a champ. With a bit of editing I limited the
macro to the body text placeholder. Thanks again.

Thanks John. I'm keeping a copy of your code. I definetly need to brush up
on my VBA.

By the way, I've been thinking. To unshadow all text within the body
placeholder and throughout the whole presentation shouldn't I simply be able
to unshadow the body placeholder within the Master Slide and thus change all
body placeholders throughout the whole presentation? I've tried this before
and well, obviously it did not work. Any thoughts?

Thanks guys.
 

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.

Ask a Question

Top