A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

export all text from slides



 
 
Thread Tools Display Modes
  #1  
Old March 7th, 2007, 08:30 PM posted to microsoft.public.powerpoint
Baher
external usenet poster
 
Posts: 10
Default export all text from slides

i have the below code. Only problem is it gives me slide1 title text and
slide168 title text. if i replace
"& oSlide.Shapes.Title.TextFrame.TextRange.Text _"
with
& oSlide.Shapes("Rectangle 2").TextFrame.TextRange.Text _

it gives me all the stuff on any slide with a group type or shape of
"Rectangle 2". thats about the extent to which i know how this code
works...thanks!

**********************code starts here
Sub GatherTitles()

On Error GoTo ErrorHandler

Dim oSlide As Slide
Dim strTitles As String
Dim strFilename As String
Dim intFileNum As Integer
Dim PathSep As String


If ActivePresentation.Path = "" Then
MsgBox "Please save the presentation then try again"
Exit Sub
End If

#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If

On Error Resume Next ' in case there's no title placeholder on the slide


For Each oSlide In ActiveWindow.Presentation.Slides
strTitles = strTitles _
& "Slide: " _
& CStr(oSlide.SlideIndex) & vbCrLf _
& oSlide.Shapes.Title.TextFrame.TextRange.Text _
& vbCrLf & vbCrLf
'& oSlide.Shapes.Title.TextFrame.TextRange.Text
Next oSlide



On Error GoTo ErrorHandler

intFileNum = FreeFile

' PC-Centricity Alert!
' This assumes that the file has a .PPT extension and strips it off to make
the text file name.
strFilename = ActivePresentation.Path _
& PathSep _
& Mid$(ActivePresentation.Name, 1, Len(ActivePresentation.Name) - 4) _
& "_Titles.TXT"

Open strFilename For Output As intFileNum
Print #intFileNum, strTitles

NormalExit:
Close intFileNum
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume NormalExit

End Sub
  #2  
Old March 7th, 2007, 10:27 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default export all text from slides

In article , Baher wrote:
i have the below code. Only problem is it gives me slide1 title text and
slide168 title text. if i replace
"& oSlide.Shapes.Title.TextFrame.TextRange.Text _"
with
& oSlide.Shapes("Rectangle 2").TextFrame.TextRange.Text _

it gives me all the stuff on any slide with a group type or shape of
"Rectangle 2". thats about the extent to which i know how this code
works...thanks!


Do the slides in question have body and title text placeholders? That is, if
you look at them in outline view, do you see the text there as well?


**********************code starts here
Sub GatherTitles()

On Error GoTo ErrorHandler

Dim oSlide As Slide
Dim strTitles As String
Dim strFilename As String
Dim intFileNum As Integer
Dim PathSep As String

If ActivePresentation.Path = "" Then
MsgBox "Please save the presentation then try again"
Exit Sub
End If

#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If

On Error Resume Next ' in case there's no title placeholder on the slide


For Each oSlide In ActiveWindow.Presentation.Slides
strTitles = strTitles _
& "Slide: " _
& CStr(oSlide.SlideIndex) & vbCrLf _
& oSlide.Shapes.Title.TextFrame.TextRange.Text _
& vbCrLf & vbCrLf
'& oSlide.Shapes.Title.TextFrame.TextRange.Text
Next oSlide

On Error GoTo ErrorHandler

intFileNum = FreeFile

' PC-Centricity Alert!
' This assumes that the file has a .PPT extension and strips it off to make
the text file name.
strFilename = ActivePresentation.Path _
& PathSep _
& Mid$(ActivePresentation.Name, 1, Len(ActivePresentation.Name) - 4) _
& "_Titles.TXT"

Open strFilename For Output As intFileNum
Print #intFileNum, strTitles

NormalExit:
Close intFileNum
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume NormalExit

End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #3  
Old March 7th, 2007, 10:36 PM posted to microsoft.public.powerpoint
Baher
external usenet poster
 
Posts: 10
Default export all text from slides

in outline view there is no text. i kinda got it to work well enough to
paste in excel and mess with it there... http://www.pptfaq.com/FAQ00274.htm
its the last part of this page where it uses a second function to get the
text out of groups as well...

"Steve Rindsberg" wrote:

In article , Baher wrote:
i have the below code. Only problem is it gives me slide1 title text and
slide168 title text. if i replace
"& oSlide.Shapes.Title.TextFrame.TextRange.Text _"
with
& oSlide.Shapes("Rectangle 2").TextFrame.TextRange.Text _

it gives me all the stuff on any slide with a group type or shape of
"Rectangle 2". thats about the extent to which i know how this code
works...thanks!


Do the slides in question have body and title text placeholders? That is, if
you look at them in outline view, do you see the text there as well?


**********************code starts here
Sub GatherTitles()

On Error GoTo ErrorHandler

Dim oSlide As Slide
Dim strTitles As String
Dim strFilename As String
Dim intFileNum As Integer
Dim PathSep As String

If ActivePresentation.Path = "" Then
MsgBox "Please save the presentation then try again"
Exit Sub
End If

#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If

On Error Resume Next ' in case there's no title placeholder on the slide


For Each oSlide In ActiveWindow.Presentation.Slides
strTitles = strTitles _
& "Slide: " _
& CStr(oSlide.SlideIndex) & vbCrLf _
& oSlide.Shapes.Title.TextFrame.TextRange.Text _
& vbCrLf & vbCrLf
'& oSlide.Shapes.Title.TextFrame.TextRange.Text
Next oSlide

On Error GoTo ErrorHandler

intFileNum = FreeFile

' PC-Centricity Alert!
' This assumes that the file has a .PPT extension and strips it off to make
the text file name.
strFilename = ActivePresentation.Path _
& PathSep _
& Mid$(ActivePresentation.Name, 1, Len(ActivePresentation.Name) - 4) _
& "_Titles.TXT"

Open strFilename For Output As intFileNum
Print #intFileNum, strTitles

NormalExit:
Close intFileNum
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume NormalExit

End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



  #4  
Old March 8th, 2007, 01:39 AM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default export all text from slides

In article , Baher wrote:
in outline view there is no text.


OK, that's why it didn't work. The routine only picks up text from the title and
body text placeholders. I was going to suggest that other routine instead, but
you're way ahead of me.

i kinda got it to work well enough to
paste in excel and mess with it there... http://www.pptfaq.com/FAQ00274.htm
its the last part of this page where it uses a second function to get the
text out of groups as well...

"Steve Rindsberg" wrote:

In article , Baher wrote:
i have the below code. Only problem is it gives me slide1 title text and
slide168 title text. if i replace
"& oSlide.Shapes.Title.TextFrame.TextRange.Text _"
with
& oSlide.Shapes("Rectangle 2").TextFrame.TextRange.Text _

it gives me all the stuff on any slide with a group type or shape of
"Rectangle 2". thats about the extent to which i know how this code
works...thanks!


Do the slides in question have body and title text placeholders? That is, if
you look at them in outline view, do you see the text there as well?


**********************code starts here
Sub GatherTitles()

On Error GoTo ErrorHandler

Dim oSlide As Slide
Dim strTitles As String
Dim strFilename As String
Dim intFileNum As Integer
Dim PathSep As String

If ActivePresentation.Path = "" Then
MsgBox "Please save the presentation then try again"
Exit Sub
End If

#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If

On Error Resume Next ' in case there's no title placeholder on the slide


For Each oSlide In ActiveWindow.Presentation.Slides
strTitles = strTitles _
& "Slide: " _
& CStr(oSlide.SlideIndex) & vbCrLf _
& oSlide.Shapes.Title.TextFrame.TextRange.Text _
& vbCrLf & vbCrLf
'& oSlide.Shapes.Title.TextFrame.TextRange.Text
Next oSlide

On Error GoTo ErrorHandler

intFileNum = FreeFile

' PC-Centricity Alert!
' This assumes that the file has a .PPT extension and strips it off to make
the text file name.
strFilename = ActivePresentation.Path _
& PathSep _
& Mid$(ActivePresentation.Name, 1, Len(ActivePresentation.Name) - 4) _
& "_Titles.TXT"

Open strFilename For Output As intFileNum
Print #intFileNum, strTitles

NormalExit:
Close intFileNum
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume NormalExit

End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================





-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.