I know there've been numerous posts regarding extraction of text from
the slides and whatnot, but what I'm interested in doing is extracting
the text from slides and then inserting that text into the notes
section of the slide.
I want to take notes for class, but I also want to be able to export
the notes section to MS Word and just print out the notes, not the
slides...
If anyone could point me to a program that can do this, I'd be greatly
appreciated, as I do not have any programming experience. Thank you!
Search http://www.pptfaq.com for terms like "text"
There are a couple of macros that export slide text and/or notes text to text
files. You could run those, then open the text file in Word.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
It could be done and wouldn't take too great an adaptation of the code in the
link I posted earlier; I just haven't the time to do it at the moment, though.
Thank you!
======
Sub ExportAllSlideText()
Dim oSlide As Slide
Dim oShape As Shape
' Interate thru each slide in the presentation
For Each oSlide In ActivePresentation.Slides
' Interate thru each shape in the current slide
For Each oShape In oSlide.Shapes
' Check if the current shape has a text frame
If oShape.HasTextFrame Then
' Check if the text frame has text in it.
If oShape.TextFrame.HasText Then
With ActivePresentation.Slides(oSlide). _
NotesPage.Shapes(2).TextFrame.TextRange
Text = .Text & vbCr & oShape.TextFrame.TextRange.Text
End With
End If
End If
Next oShape
'Next slide
Next oSlide
'End routine
End Sub
======
What's wrong? The error message I get is: "Slides (unknown member): Bad
argument type. Expected collection index (string or integer)."
Thanks.
Hey, that's the spirit ... jump in there and have at it.
See the comment below:
> I pasted some snippets of code together and got this:
>
> ======
> Sub ExportAllSlideText()
> Dim oSlide As Slide
> Dim oShape As Shape
>
> ' Interate thru each slide in the presentation
> For Each oSlide In ActivePresentation.Slides
>
> ' Interate thru each shape in the current slide
> For Each oShape In oSlide.Shapes
>
> ' Check if the current shape has a text frame
> If oShape.HasTextFrame Then
>
> ' Check if the text frame has text in it.
> If oShape.TextFrame.HasText Then
Change this:
> With ActivePresentation.Slides(oSlide). _
> NotesPage.Shapes(2).TextFrame.TextRange
> Text = .Text & vbCr & oShape.TextFrame.TextRange.Text
> End With
With oSlide.NotesPage.Shapes(2).TextFrame.TextRange
Text = .Text & vbCr & oShape.TextFrame.TextRange.Text
End With
> End If
> End If
> Next oShape
>
> 'Next slide
> Next oSlide
>
> 'End routine
> End Sub
> ======
>
> What's wrong? The error message I get is: "Slides (unknown member): Bad
> argument type. Expected collection index (string or integer)."
>
> Thanks.
>
-----------------------------------------
Any ideas? =/
With oSlide.NotesPage.Shapes(2).TextFrame.TextRange
Text = Text & vbCr & oShape.TextFrame.TextRange.Text
MsgBox Text
End With
Just to see what "Text" contained...it seems as if the text from the
slides is being collected, but it's not being saved/placed into the
notes section of each slide.
I made a test Powerpoint file of 5 slides with slide text on each
slide. The MsgBox showed that "Text" collected each line of the slide
text and kept adding on to it and by the end, "Text" contained words
from ALL 5 slides, rather than saving all the text from each slide to
its respective notes section and then clearing the variable.
======
Sub ExportAllSlideText()
Dim oSlide As Slide
Dim oShape As Shape
' Interate thru each slide in the presentation
For Each oSlide In ActivePresentation.Slides
' Interate thru each shape in the current slide
For Each oShape In oSlide.Shapes
' Check if the current shape has a text frame
If oShape.HasTextFrame Then
' Check if the text frame has text in it.
If oShape.TextFrame.HasText Then
' This is to keep adding text from each Shape to Text and then insert
it into the Notes
Text = Text & vbCr & oShape.TextFrame.TextRange.Text
oSlide.NotesPage.Shapes(2).TextFrame.TextRange.Text = Text
' Check to see what's in Text
' MsgBox Text
End If
End If
Next oShape
' Clear Text & Next slide
Text = ""
Next oSlide
'End routine
End Sub
======
Hope it helps somebody out there in the world! =)
Aw nuts. Bad eyes, small screen on this laptop ...
Sorry ... I missed this:
>
With oSlide.NotesPage.Shapes(2).TextFrame.TextRange
.Text = .Text & vbCr & oShape.TextFrame.TextRange.Text
MsgBox .Text
End With
Put a period in front of the word "Text" in three places.
>
> Just to see what "Text" contained...it seems as if the text from the
> slides is being collected, but it's not being saved/placed into the
> notes section of each slide.
>
> I made a test Powerpoint file of 5 slides with slide text on each
> slide. The MsgBox showed that "Text" collected each line of the slide
> text and kept adding on to it and by the end, "Text" contained words
> from ALL 5 slides, rather than saving all the text from each slide to
> its respective notes section and then clearing the variable.
>
-----------------------------------------
Beauty! Good work!