PP automation - choosing a theme or going with default colours

S

Silvester

I am automating PP2000 from an A2000 app using VBA.

Basically the data for the textbox on the slides will be taken from a query
based on database memo field data.

Before generating the slide I would like to give users the option of a
default color scheme of darkblue back with yellow text or to choose a PP
theme and go with those backgrounds and color scheme.

I've just put in a code excerpt of how I set the default slideshow
background - this is not the complete code - how would I give users the
option of choosing a PP theme and following the theme colours --- or going
with the default yellow on darkblue?

I need help with the coding please.

Thanks
___________________

Dim oPPT As PowerPoint.Application
Dim oPres As PowerPoint.Presentation
Set oPPT = New PowerPoint.Application
Set oPres = oPPT.Presentations.Add(True)

With oPres

For xloop = 1 To TotalSlides
.Slides.Add xloop, ppLayoutBlank

Select Case xloop
'---------------------------------------------
'SET THE BACKGROUND
'-------------------------------------------
Case xloop
With .Slides(xloop)
.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoTrue
With .Background
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(0, 51, 102)
.Fill.Transparency = 0#
.Fill.Solid
End With
End With

'--------------------------------------
' Add the TEXT BOX
'----------------------------------------

.Slides(xloop).Shapes.AddTextbox msoTextOrientationHorizontal, 10#, 10#,
700#, 36#
.Slides(xloop).Shapes.Range.TextFrame.WordWrap = msoTrue
.Slides(xloop).Shapes.Range.TextFrame.AutoSize = ppAutoSizeNone
.ExtraColors.Add RGB(Red:=255, Green:=255, Blue:=0)

With .Slides(xloop).Shapes(2).TextFrame.TextRange
.Characters Start:=1, Length:=0
.Text = strReplacedWords
With .Font
.Name = "Courier New"
.Size = 12
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoTrue
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppBackground
End With
End With
 
S

Steve Rindsberg, PPTMVP

Sorry if this sounds like nitpicking, but PowerPoint doesn't have anything
called "themes". Just so we're clear on what you want to do, did you mean
color schemes?
 
S

Silvester

Steve,

Thanks for clarifying. I meant "design templates", not colour schemes.

I want to be able to give users 2 options before generating the slides on
the fly:

Option 1 (default)
No design template
Blue background (colour)
Yellow foreground (text)

Option 2
user-selected PP design template including template foreground colour
 
S

Steve Rindsberg, PPTMVP

Silvester,

Great. Glad that got settled.

You can easily grab the code for applying a design template by recording a
macro while you do it manually. There may be some implementation
differences in 2002 vs 2000 but let's put that aside for now.

I'd also create a "standard" template of your own so your logic becomes
simpler. Instead of having to create the blue b/g, yellow text slide from
scratch each time, just apply your standard template - let PPT do the work
for you.
 

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