retrieving transition information

G

Guest

Hello

I would like to be able to retrieve information about transitions, and
incorporate that into a printout of the outline view. I would like the name
of the transition, and the speed if it is applicable. If it can't be done
easily into the outline view, at least some sort of file that includes the
slide title text and transition information, that could be printed, say from
Excel. I thought there was mention of something like this a few years back,
but i can't find it in the copies of messages I've kept.

Thanks,

Villem Teder
Toronto
 
S

Steve Rindsberg

Villem Teder said:
Hello

I would like to be able to retrieve information about transitions, and
incorporate that into a printout of the outline view. I would like the name
of the transition, and the speed if it is applicable. If it can't be done
easily into the outline view, at least some sort of file that includes the
slide title text and transition information, that could be printed, say from
Excel. I thought there was mention of something like this a few years back,
but i can't find it in the copies of messages I've kept.

Something like this might be a start ...

Show me the transition time of each slide and total running time of the show
http://www.pptfaq.com/FAQ00413.htm

And maybe marry that with this:

Export Text to a text file, extract text from PowerPoint (Mac or PC)
http://www.pptfaq.com/FAQ00274.htm
 
V

villem teder

Hi Steve

Having managed to stay a code virgin for so long, I've finally taken
the plunge. Trying the code in FAQ00413 actually worked, following the
instructions.

However, the results were as I feared. I have seen that FAQ item
listed before, but since it mentioned only slide timings, and I do not
use timings for these files, I assumed that the code would not be of
much use. My assumptions have been confirmed.

What do I need to change to get the name of the transition on each
slide, and speed, if applicable?

Thanks,

Villem
 
S

Steve Rindsberg

Hi Steve

Having managed to stay a code virgin for so long, I've finally taken
the plunge. Trying the code in FAQ00413 actually worked, following the
instructions.

Oh dear. I'll have to change *that*. Mustn't let the mystery wear too thin. ;-)
However, the results were as I feared. I have seen that FAQ item
listed before, but since it mentioned only slide timings, and I do not
use timings for these files, I assumed that the code would not be of
much use. My assumptions have been confirmed.

What do I need to change to get the name of the transition on each
slide, and speed, if applicable?

Here's a start. You can work out how to incorporate this into what you've already
worked with, I think. If not, you know where to find us.

The names will involve some manual labor ... PPT won't tell you the names, just
the numbers, but the function below will convert them for you. Once you do the
hard bit ... <g>

To get a head start on that, go into the VB editor, press F2 to open the object
browser and search for EntryEffect. One you find the right one, you'll see a
whole list of effect names and if you click on one, you'll see its value in the
pane below. Modify the function below to equate the value with the name you want
to see and ... in only hours of mindnumbing, fingerbreaking, eyestraining labor
... youv'e got it.

Sub StuffForVillem()

Dim osld As Slide

For Each osld In ActivePresentation.Slides

With osld.SlideShowTransition
Debug.Print "Entry effect" & vbTab & NameThatTransition(.EntryEffect)
'.EntryEffect = ppEffectCombHorizontal
Debug.Print "Speed" & vbTab & .Speed
'.Speed = ppTransitionSpeedFast
If .AdvanceOnTime Then
Debug.Print "Advance time" & vbTab & .AdvanceTime
End If
If .AdvanceOnClick Then
Debug.Print "Advance on click"
End If
End With ' transition

Next ' slide

End Sub

Function NameThatTransition(lTransition As Long) As String

Select Case lTransition
Case 0
NameThatTransition = "None"
' and so on ... you'll need to edit these to get the string to
' match up with the transitions you use most often
Case 1
NameThatTransition = "1"
Case 2
NameThatTransition = "2"

Case Else
' this just hands back a number for the ones you haven't matched up
NameThatTransition = CStr(lTransition)
End Select

End Function
 
V

villem teder

Many thanks, Steve. That will keep me busy for a little while as I try
to find some spare time. Actually, in my getting older, I realize I
should have said I was a VBA virgin. I had forgotten that a long time
ago I had dabbled with GWBasic to write a little program to go through
"dir:\x *.* /S >" dumps to preformat the text so that I could import
the files into Excel to create indices.

Again, thanks,

Villem

Now to remember what I did with that copy of David Marcovitz's book
that I got recently...
 
S

Steve Rindsberg

Many thanks, Steve. That will keep me busy for a little while as I try
to find some spare time. Actually, in my getting older, I realize I
should have said I was a VBA virgin.

A semi-virgin then?
 
V

villem teder

Diving in head-first, I've managed to create something that satifies
my initial criteria. After studying (playing with) your code, Steve,
and trying various ways to combine it with the samples in the PPTFAQ,
below is what I've come up with.

Now, to work on what i really want, which is to include the transition
information in a printout of the outline, with fonts and formatting.
From what I can see so far, using VBA looses any text formatting and
just exports plain ASCII. I'm guessing the ideal way is to add the
info to the text in the title placeholder. Time for more studying.

Thanks Steve, for the help so far.

Villem
----------------------------------------

Attribute VB_Name = "Module1"
Sub VillemsAttempt()

Dim osld As Slide
Dim strMessage As String

For Each osld In ActivePresentation.Slides

With osld.SlideShowTransition

strMessage = strMessage _
& "sn:" _
& CStr(osld.SlideNumber) _
& vbTab _
& NameThatTransition(.EntryEffect) _
& vbTab _
& HowFast(.Speed) _
& vbTab _
& CStr(osld.Shapes.Title.TextFrame.TextRange.Text) _
& vbCrLf

End With

Next osld

Dim FileNum As Integer
Dim FileName As String

FileName = "C:\temp\transitions.txt"

FileNum = FreeFile()
Open FileName For Output As FileNum
Print #FileNum, strMessage
Close #FileNum

End Sub


Function NameThatTransition(lTransition As Long) As String

Select Case lTransition
Case 0
NameThatTransition = "None"
Case 257
NameThatTransition = "Cut"
Case 1793
NameThatTransition = "Fade"
Case Else
NameThatTransition = CStr(lTransition)
End Select


End Function

Function HowFast(lSpeed As Long) As String

Select Case lSpeed
Case 1
HowFast = "Slow"
Case 2
HowFast = "Medium"
Case 3
HowFast = "Fast"

End Select

End Function
 
S

Steve Rindsberg

Diving in head-first, I've managed to create something that satifies
my initial criteria. After studying (playing with) your code, Steve,
and trying various ways to combine it with the samples in the PPTFAQ,
below is what I've come up with.

You're quick, sir. Very quick.

To get it nicely formatted, one thought is to create a new presentation, make
the slide name or number the title of each slide and the various other bits
bullet points beneath the title.

You could then save this as an outline and print from Word after formatting to
taste. Or if it works out acceptably, print the outline directly from PPT.

So suppose at the beginning you create a new temporary presentation:

Dim oPres as Presentation
Set oPres = Presentations.Add

Then create two strings instead of one. The first is the slide name or "Slide
" number, the second is the bits of information you've captured already, but
this time with a lineending between each:

sBodyText = "This" & VbCRLF & "That" & VbCRLF ... etc.

Once you've grabbed the text for each slide, do

Call AddNewStuff(oPres, sTitle, sBodyText)

It'll add a new slide to the end of the temporary presentation, put the slide
name and other info into the title/body text placeholders.

You can manually print, save, close the temp presentation as suits your needs.

Give it a shot, Sir Caps. <g>

Sub AddNewStuff(oPres as Presentation, _
sTitle As String, _
sBodyText As String)

Dim oSl As Slide

' this is all one line ... watch out
' for line breaks:
Set oSl = oPres.Slides.Add(Index:=ActivePresentation.Slides.Count + 1,
Layout:=ppLayoutText)

' This is not the best way to get at title/body text
' placeholders but in this case it should be reliable enough
' and is nice and simple

With oSl.Shapes("Rectangle 2")
.TextFrame.TextRange.Text = sTitle
End With

With oSl.Shapes("Rectangle 3")
.TextFrame.TextRange.Text = sBodyText
End With

End Sub
 

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