PDA

View Full Version : Slide location



jlingle
02-11-2012, 06:36 AM
This seems a simple question, but...

I simply want to determine the slide position in a deck in "Normal View". It was easy to find how to do it in SlideShowView, but not so easy in Normal View. I've fiddled and searched for a day or two now and nothing seems to work. I'd appreciate any help anyone can offer. Thanks.

John Wilson
02-12-2012, 09:41 AM
It's not at all clear what you mean.

You can get the index of the slide in view in edit view.

Sub MakeShadow5()
On Error Resume Next
Err.Clear
MsgBox "The current slide is Slide " & ActiveWindow.View.Slide.SlideIndex
If Err <> 0 Then
ActiveWindow.ViewType = ppViewNotesPage
ActiveWindow.ViewType = ppViewNormal
MsgBox "The current slide is Slide " & ActiveWindow.View.Slide.SlideIndex
End If
End Sub
the 'extra' code fixes the error when the selction is between slides in the thumbnail view.

jlingle
02-14-2012, 01:00 PM
Thanks John. Sorry I wasn't clearer, but you hit the nail on the head. I got it working fine. Actually, part of my problem was that I was trying to execute a similar line of code in the immediate window rather than in a line of code in a module. I thought the code was in error, but it was simply how I was trying to use the editor to execute it. Lot's to learn all at once. I really appreciate your taking the time to respond to a newbie with a very simple question. I'll take a look at the link at the bottom of your post. John

jlingle
02-14-2012, 01:03 PM
One more question for John or anyone else. There are lots of good books on programming VBA for Excel. I have not been able to find a good book on programming PowerPoint VBA. Does anyone have a recommendation?

Cosmo
02-15-2012, 06:37 AM
One more question for John or anyone else. There are lots of good books on programming VBA for Excel. I have not been able to find a good book on programming PowerPoint VBA. Does anyone have a recommendation?
The only book I ever found which is dedicated to VBA in PowerPoint is 'Powerful PowerPoint for Educators':
http://www.amazon.com/Powerful-PowerPoint-Educators-Applications-Interactive/dp/1591580951/ref=sr_1_1?s=books&ie=UTF8&qid=1329312860&sr=1-1

There are a few VB/VBA books which might dedicate a few paragraphs or a chapter to PowerPoint, but not much.

John Wilson
02-15-2012, 07:15 AM
David's book is the only one dedicated to PowerPoint vba. It's not cheap and rarely a bargain second hand.

Is it good for you, depends what you want. It's really aimed at Teachers who want to use a little vba in their presentations to make them interactive,

If you are looking for a complete guide to the PowerPoint object model it isn't that.

I have Office XP Development with vba by Peter Aitken. Obviously a little (not much) out of date now and only one chapter on PowerPoint but thourough. It is often to be found cheap second hand and it's worth having if you can get it for a few dollars (mine was $7)

For me though I'd ask questions here and also study the code samples on our site (http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html#vba), Shyam Pillai's site (http://skp.mvps.org/vba.htm) and PPTFAQ (http://www.pptfaq.com/index.html). and see if you can work out how they work.

jlingle
02-15-2012, 01:37 PM
Thanks guys. Very helpful. I've basically been reading my VBA for Excel book and then fiddling with the PPT code until I can get it to work. The application I've been working on adjusts charts and tables in a PP deck from data contained in a multi-tab Excel spreadsheet.

delete123
03-26-2012, 09:30 AM
ShowSlideWindows(1).View.Next