MS Office Forum / General PowerPoint Questions / February 2007
retrieving transition information
|
|
Thread rating:  |
Villem Teder - 29 Jan 2007 23:22 GMT 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
Steve Rindsberg - 30 Jan 2007 05:47 GMT > Hello > [quoted text clipped - 5 lines] > 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
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
villem teder - 31 Jan 2007 18:48 GMT 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
>> Hello >> [quoted text clipped - 21 lines] >PPTools: www.pptools.com >================================================ Steve Rindsberg - 01 Feb 2007 02:36 GMT > 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 [quoted text clipped - 3 lines] > 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
> Thanks, > [quoted text clipped - 25 lines] > >PPTools: www.pptools.com > >================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
villem teder - 01 Feb 2007 04:47 GMT 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...
>> Hi Steve >> [quoted text clipped - 103 lines] >PPTools: www.pptools.com >================================================ Steve Rindsberg - 01 Feb 2007 16:35 GMT > 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?
> I had forgotten that a long time > ago I had dabbled with GWBasic to write a little program to go through [quoted text clipped - 115 lines] > >PPTools: www.pptools.com > >================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
villem teder - 04 Feb 2007 14:17 GMT 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
Steve Rindsberg - 04 Feb 2007 17:01 GMT > 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
> 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. [quoted text clipped - 72 lines] > > End Function ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
|
|
|