VBA/Excel/Access/Word/PowerPoint/Slide Master
Содержание
- 1 Checks that the title master exists and, if it does, formats the date and time to be visible and to use the dMMMyy format with automatic updating:
- 2 clears the HeaderFooter objects in the notes master in the first open presentation:
- 3 Deleting a Master
- 4 To find out whether a presentation has a title master, check the HasTitleMaster property
- 5 Working with Headers and Footers
- 6 Working with the Handout Master
- 7 Working with the Slide Master
Checks that the title master exists and, if it does, formats the date and time to be visible and to use the dMMMyy format with automatic updating:
Sub master()
With ActivePresentation
If .HasTitleMaster Then
With .TitleMaster.HeadersFooters.DateAndTime
.Visible = msoTrue
.Format = ppDateTimedMMMyy
.UseFormat = msoTrue
End With
End If
End With
End Sub
Sub header()
Presentations(1).NotesMaster.HeadersFooters.Clear
End Sub
Deleting a Master
Sub titleMaster()
If ActivePresentation.HasTitleMaster Then ActivePresentation.TitleMaster.Delete
End Sub
To find out whether a presentation has a title master, check the HasTitleMaster property
Sub hasMaster()
If Not ActivePresentation.HasTitleMaster Then ActivePresentation.AddTitleMaster
End Sub
Sub footer()
ActivePresentation.SlideMaster.HeadersFooters.Footer.Text = "text"
End Sub
Working with the Handout Master
Sub background()
With ActivePresentation.HandoutMaster.Background
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.BackColor.SchemeColor = ppAccent1
.Fill.UserPicture "d:\n.jpg"
End With
End Sub
Working with the Slide Master
Sub addTitle()
ActivePresentation.SlideMaster.Shapes.addTitle.TextFrame.TextRange.Text = _
"Orientation"
End Sub