View Full Version : Open PowerPoint file to a specific slide

Echo S
02-26-2004, 10:11 AM
Hi, all, I'm hoping you can help me here.

I've got a series of buttons on my Autoplay Media Studio page which open the same PPS file. (In case you don't know, a PPS is just like a PPT PowerPoint file, except it opens automatically in full-screen show view as opposed to opening to the PPT editing window.)

I'd like each of these buttons to open the file to a different slide. For instance, Button 1 should open to slide 1. Button 2 should open to slide 6, which begins the second "section" of the PPS file.

In PowerPoint itself, you can hyperlink to slides within a presentation by using <filename>#<slide number>. So I could link to, for instance, myfile.pps#6 to open on slide 6. This is also how you'd do it if you were linking to a PPT/PPS file from within another MS Office application such as Word.

I tried that syntax in AMS, but it doesn't seem to work:
File.Open("AutoPlay\\Docs\\echo.pps#6", "", SW_SHOWNORMAL);

Of course,
File.Open("AutoPlay\\Docs\\echo.pps", "", SW_SHOWNORMAL);
works just fine.

Another way to call a specific slide is to use <filename>#<Slide ID>,<Slide Index>. You can find the Slide ID and Slide Index by opening PPT in IE and looking at the address window. So I tried that syntax as well:
File.Open("AutoPlay\\Docs\\echo.pps#546,6", "", SW_SHOWNORMAL);

It doesn't work, either.

Do any of you know how to open a PPT/PPS file to a specific slide? Is there a second action line or line of code I can add? (Played with Page Jump, but that didn't work, either.)

I would really really really rather not have to break this slide file up into a bunch of individual PPT/PPS files just because I can't figure out how to make AMS open them from anything but the first slide!

Any suggestions appreciated.


02-26-2004, 10:32 AM
Try using File.Run

File.Run("AutoPlay\\Docs\\echo.pps", "#6", "", SW_SHOWNORMAL, false);

Echo S
02-26-2004, 11:13 AM
Oh, I had such high hopes for that. Unfortunately, it didn't work.

I tried various options within File.Run as well, exchanging "#546,6" for "#6" for example, but nothing did the trick.

I also tried File.OpenURL. That will open the PPT file with no problems, but it won't open to a specific slide.

Any other ideas?


02-26-2004, 11:29 AM
Try here


Use File.Run (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/File.Run.htm)

File.Run("\\directory\\pptview.exe", "/n5 \"Presentations\\presentation.ppt\"", "C:\\Temp", SW_SHOWNORMAL, true);


Echo S
02-26-2004, 11:48 AM
Duh! It didn't even occur to me to use the PPT Viewer and command lines, since all of my recipients will have PPT.

I actually have tutorials for creating PPT autorun CDs on my site -- http://www.echosvoice.com -- but I've obviously not had to do that in conjunction with AMS.

Thanks so much for the suggestion. I'll mess with this a bit and see if I can make it do what I want.


02-26-2004, 12:32 PM
Here is a project that I put together with PPTVIEW.EXE that will launch an included ppt file to the appropriate page.

It is just over 2MB

Click here (http://s94928149.onlinehome.us/pub/pptviewer.apz)

Echo S
02-26-2004, 03:28 PM
SWEET! Using the PPT Viewer worked like a charm, and the sample file you posted was very helpful to me.

Thank you so very much! If I can ever help you with PPT directly, just holler.

Thanks again!

02-26-2004, 06:17 PM
NP glad to help.