# VBA to change text on two slide masters



## Agathron (Oct 29, 2004)

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....


```
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


```
ActivePresentation.Slides(#).Select
```

Thanks and have a great weekend.
[/code]


----------



## Agathron (Nov 2, 2004)

For those of you interested, here's the code I used


```
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.


----------

