Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA and PPT 2007 Slide Masters

Status
Not open for further replies.

MarkNie

Technical User
Sep 22, 2005
102
0
0
GB
Hi All

Any help with the below would be great.

I am trying to select a specific slide master in order to insert watermark text on the slides which have the hide background graphics ticked.

Code so far:

Sub ToggleWatermarkTest()

Dim HBShape As Shape

If ActivePresentation.SlideMaster.Name = "Title Slide" Then
MsgBox "Selected", vbExclamation
Else
MsgBox "Not Selected", vbExclamation
End If


End Sub

This was just to see if I can select a Slide Master with the name. But this does not seem to work.

Thanks again for you help!!

This is the code I have used to change the Main Master in 2007 which works fine, now it is just the slides that have the hide background graphics ticked:

Sub ToggleWatermark()

Dim HBShape As Shape

ActiveWindow.ViewType = ppViewSlideMaster
For Each HBShape In ActivePresentation.SlideMaster.Shapes
If HBShape.Type = msoAutoShape Then
ActivePresentation.SlideMaster.Shapes.SelectAll
HBShape.Delete
ActiveWindow.ViewType = ppViewNormal
Exit Sub

End If

Next

ActiveWindow.ViewType = ppViewSlideMaster
ActivePresentation.SlideMaster.Shapes.AddTextEffect(msoTextEffect5, "DRAFT VERSION - DO NOT USE", "Arial", 36#, msoTrue, msoFalse, 240.38, 249.12).Select
With ActiveWindow.Selection.ShapeRange
.Line.Visible = msoFalse
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.BackColor.RGB = RGB(255, 255, 255)
.Fill.Transparency = 1#
.Rotation = 330#
.IncrementLeft -223#
.IncrementTop 8.12

End With

ActiveWindow.ViewType = ppViewNormal

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top