Powerpoint to Word

A

Allen

I have 100 presentations consisting of 1 to 12 slides
each. Each slide has 1 or 2 text boxes only.

I need to get the text into 1 Word document per
presentation. Manually I would open the presentation,
select the first slide, select the text box,

and then either

a) select all the text, then cut and paste into Word
or
b) use FILE, SEND TO, Microsoft Word.

both are too tedious to use for hundreds of slides, and
neither records properly as a macro.

I am unfamiliar with the powerpoint object model. Can
someone point me in the right direction?

Thanks,
Allen
 
S

Steve Rindsberg

I have 100 presentations consisting of 1 to 12 slides
each. Each slide has 1 or 2 text boxes only.

I need to get the text into 1 Word document per
presentation. Manually I would open the presentation,
select the first slide, select the text box,

and then either

a) select all the text, then cut and paste into Word
or
b) use FILE, SEND TO, Microsoft Word.

both are too tedious to use for hundreds of slides, and
neither records properly as a macro.

I am unfamiliar with the powerpoint object model. Can
someone point me in the right direction?

This may help with the PowerPoint end of things:

Export Text to a text file (Mac or PC)
http://www.rdpslides.com/pptfaq/FAQ00274.htm



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
A

Allen

-----Original Message-----


This may help with the PowerPoint end of things:

Export Text to a text file (Mac or PC)
http://www.rdpslides.com/pptfaq/FAQ00274.htm



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================

.
Thanks Steve.

It looks like that will do 90% of what I need. If I put
a "for each presentation" loop around it and load 20
presentations at a time my job will be done quickly. I
then just have to open the text file in Word and split it
into presentations.
 
S

Steve Rindsberg

Thanks Steve.

It looks like that will do 90% of what I need. If I put
a "for each presentation" loop around it and load 20
presentations at a time my job will be done quickly. I
then just have to open the text file in Word and split it
into presentations.

That'd do it.

Sub DoLots()
Dim oPres as Presentation

For Each oPres in Presentations
' use the code from the link here but
' work with oPres instead of ActivePresentation

Next oPres
End Sub

You might also want to parse the .PPT off of oPres.Fullname and append .TXT to
create a file for each presentation instead of having to split them up in Word.


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
G

Guest

-----Original Message-----

That'd do it.

Sub DoLots()
Dim oPres as Presentation

For Each oPres in Presentations
' use the code from the link here but
' work with oPres instead of ActivePresentation

Next oPres
End Sub

You might also want to parse the .PPT off of
oPres.Fullname and append .TXT to
create a file for each presentation instead of having to split them up in Word.


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================

.
Great minds think alike...

I went home and played with the code, coming up with the
following:

Sub ExportText()
Attribute ExportText.VB_Description = "Export text in
slides to plain text file"
'
'Original macro from Kris Lander
'Modified by Steve Rindsberg
'Modified by Allen N. Humphries to work with all open
presentations
'
Dim oPres As Presentation
Dim oPress As Presentations
Dim oSlides As Slides
Dim oSld As Slide 'Slide Object
Dim oShp As Shape 'Shape Object
Dim FileNum As Integer
Dim iFile As Integer 'File handle for output
Dim PathSep As String
Dim Response As Integer
#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If
Set oPress = Presentations
iFile = FreeFile 'Get a free file number
FileNum = FreeFile
For Each oPres In oPress 'Loop thru each presentation
'Open output file
'NOTE: errors here if file hasn't been saved
Open oPres.Path & PathSep & oPres.Name & ".txt" For Output
As FileNum
Print #iFile, UCase(Left(oPres.Name, Len(oPres.Name) - 4))
& vbCrLf
'Set oPres = ActivePresentation
Set oSlides = oPres.Slides
For Each oSld In oSlides 'Loop thru each slide
For Each oShp In oSld.Shapes 'Loop thru each shape on slide
'Check to see if shape has a text frame and text
If oShp.HasTextFrame And oShp.TextFrame.HasText Then
If oShp.Type = msoPlaceholder Then
Select Case oShp.PlaceholderFormat.Type
Case Is = ppPlaceholderTitle, ppPlaceholderCenterTitle
Print #iFile, "Title:" & vbTab &
oShp.TextFrame.TextRange & vbCrLf
Case Is = ppPlaceholderBody
Print #iFile, "Body:" & vbTab &
oShp.TextFrame.TextRange & vbCrLf
Case Is = ppPlaceholderSubtitle
Print #iFile, "SubTitle:" & vbTab &
oShp.TextFrame.TextRange & vbCrLf
Case Else
Print #iFile, "Other Placeholder:" & vbTab &
oShp.TextFrame.TextRange & vbCrLf
End Select
Else
Print #iFile, oShp.TextFrame.TextRange & vbCrLf
End If ' msoPlaceholder
End If ' Has text frame/Has text
Next oShp
Next oSld
Close #iFile 'Close output file
Next oPres
Response = MsgBox("Text files completed", , "Export text")
End Sub

It operates on any open presentation.
It puts the presentation file name as the first line in
the text file.
It creates a separate text file for each presentation
It removes .ppt and appends .txt
It adds a carriage return/line feed after each shape for
readability.
It displays a simple alert box when complete.

I would not have had a clue how to start it. With your
help, I now have a program that does exactly what I needed
it to do.

Many thanks!
 
S

Steve Rindsberg

I would not have had a clue how to start it. With your
help, I now have a program that does exactly what I needed
it to do.

Many thanks!

Aw, you'd have gotten there. This was just a shortcut. <g> Anyhow, very
pleased to have helped.



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top