Getting whole text of first slide(master slide?) of a ppt

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am in the process of searching a particular word in a PPT using a VB tool. Is there any way of getting the whole content of the master slide?

Ta,
K. Rajasekar
 
The best way may be to loop thru each of the objects on the slide, notes and
master looking for text boxes/frames.


Bill Dilworth, Microsoft PPT MVP
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..


K. Rajasekar said:
Hi

I am in the process of searching a particular word in a PPT using a VB
tool. Is there any way of getting the whole content of the master slide?
 
Hi
I am in the process of searching a particular word in a PPT using a VB tool. Is there any way of getting the whole content of the master slide?

Ta,
K. Rajasekar


This should be adaptible to what you need:

Sub MasterText()

Dim oPres As Presentation
Dim oSlides As Slides
Dim oSlide As Slide
Dim oShapes As Shapes
Dim oSh As Shape
Dim NotesText As String
Dim SlideMasterText As String

Set oPres = ActivePresentation
Set oSlides = oPres.Slides

' Get the master text
Set oShapes = ActivePresentation.SlideMaster.Shapes
For Each oSh In oShapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
SlideMasterText = SlideMasterText & oSh.TextFrame.TextRange.Text & vbCrLf
End If
End If
Next oSh

' Get the TitleMaster text if any
If ActivePresentation.HasTitleMaster Then
Set oShapes = ActivePresentation.TitleMaster.Shapes
For Each oSh In oShapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
SlideMasterText = SlideMasterText & oSh.TextFrame.TextRange.Text & vbCrLf
End If
End If
Next oSh
End If

Debug.Print SlideMasterText

' Get the notes text for all slides
For Each oSlide In oSlides
NotesText = NotesText & "Slide " & oSlide.SlideIndex & vbCrLf
Set oShapes = oSlide.NotesPage.Shapes
For Each oSh In oShapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
NotesText = NotesText & oSh.TextFrame.TextRange.Text
End If
End If
Next oSh
NotesText = NotesText & vbCrLf
Next oSlide


End Sub
 
Back
Top