VBA to change text on two slide masters

Agathron

New Member
Joined
Oct 14, 2004
Messages
42
Hi folks,

I'm working on a power point presentation that has two slide masters and I want to change the footer on them both. My code currently reads....

Code:
ActiveWindow.ViewType = ppViewSlideMaster
    ActivePresentation.SlideMaster.Shapes("Rectangle 4").Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=17).Select
    ActiveWindow.Selection.TextRange.Text = "Type1"

Problem is I now want to switch to the other slide master and have it change the text in what is "Rectangle 4" there as well. I tried returning to a regular view, and switching to slide using the second master and repeating but it keeps changing only the first slide master. Is there a slidemaster equivalent to

Code:
 ActivePresentation.Slides(#).Select

Thanks and have a great weekend.
[/code]
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
For those of you interested, here's the code I used

Code:
Sub DateTimeMaster(dateTime As String)
    
    If ActivePresentation.HasTitleMaster Then
        With ActivePresentation.TitleMaster.HeadersFooters
            With .DateAndTime
                .Format = ppDateTimeMMMMdyyyy
                .Text = dateTime
                .UseFormat = msoFalse
                .Visible = msoTrue
            End With
            .Footer.Visible = msoFalse
            .SlideNumber.Visible = msoTrue
        End With
    End If
    With ActivePresentation.SlideMaster.HeadersFooters
        With .DateAndTime
            .Format = ppDateTimeMMMMdyyyy
            .Text = dateTime
            .UseFormat = msoFalse
            .Visible = msoTrue
        End With
        .Footer.Visible = msoFalse
        .SlideNumber.Visible = msoTrue
    End With
End Sub

Hope this helps someone.
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,952
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top