Articles Archive
Articles Search
Director Wiki
 

PowerPoint in a Window

January 5, 1999
by Fred Bals

"Embedding" PowerPoint in Director

The idea that PowerPoint is a useful tool for multimedia presentations might invoke incredulity in some developers. Actually, PowerPoint is a more powerful multimedia tool than many people realize. Even unsophisticated users can quickly create linear electronic slide shows with PowerPoint. Those willing to spend time learning the program's features can easily add sound, video, hyperlinks, and fairly sophisticated animation to their presentations.

No one (except a Microsoft product manager) would argue that PowerPoint is Director’s equal for creating multimedia. But for simple projects, I’ve found that PowerPoint is often a good alternative. For example, its ability to dynamically scale a presentation to the display area eliminates the familiar Director problem of whether to build projects for 640 x 480, 800 x 600 or other size displays. However, the major benefit of using PowerPoint is its prevalence in the business world.

Thanks to Microsoft Office, nearly every business PC already has the program installed, whether used or not. Microsoft also provides the free PowerPoint Viewer application for Windows 3.1 and Windows 95/98, which can be used to view shows on machines where PowerPoint isn’t installed. I’ll digress a moment to note that this article is Windows-centric. While I like to think that I’m platform-agnostic, the business reality is that my clients demand Windows solutions, and that’s where my focus lies.

Since most business people have some familiarity with PowerPoint, it’s also very useful in projects where end-users want to modify titles, text, and graphics in order to create customized versions of a presentation.

My company, Quantic Communications, regularly creates what we term "Electronic Asset" CDs for clients. In essence, an Electronic Asset CD collects a variety of electronic business files—white papers created in Word, data sheets and brochures in Adobe Acrobat PDF format, Excel spreadsheets, video clips—and integrates them under a slick Director interface.

Business clients love the idea of being able to replace the cost and bulk of paper-based sales kits with an Electronic Asset CD. Salespeople love the idea of having everything they need to make a pitch on one CD. One common asset included on almost every CD we develop is a template PowerPoint presentation that can be modified by the sales person.

If you’re developing business multimedia, the chances are good that you’ll be asked to integrate PowerPoint content into a Director presentation at some point in your career. This article explores strategies you can use to do so, including creating the illusion that you've "embedded" a PowerPoint show into a Director movie—in essence, giving the appearance of PowerPoint in a Window.

The PowerPoint Import Xtra Blues

Beginning with 6.5, Director includes an Xtra allowing you to import PowerPoint 4 presentations during authoring. Unfortunately, my experience has been that, like some other Macromedia "solutions" (the old Player for Windows and the more recent Export Xtra for Java come to mind), this Xtra’s capabilities are so limited as to be useless for real world projects.

As I noted, the Xtra will only import PowerPoint 4 shows. While this may seem like a minor detail, as later versions of PowerPoint can save out in 4 format, many animations and transitions will be lost during the conversion, requiring that they be rebuilt in Director.

The Xtra also requires massive amounts of memory to import anything but the smallest PowerPoint show. In one test on a machine with 70 MB of RAM installed, I was forced to save out a 10 MB PowerPoint show as six files in order to get the content into separate Director movies. The Xtra's documentation recommends that you "recombine the Director movie files by cutting and pasting", but this is not a trivial undertaking for large presentations.

While the documentation blithely states that the Xtra will import "...artwork, text, and transitions..." and assemble a Score resembling the original PowerPoint show, my experience has been that much of the original art, text, and transitions will be missing or grossly changed for all but the simplest presentations.

But the Xtra’s most damning fault is its primary feature, in that it re-creates an internal version of the original PowerPoint show rather than linking to an external file. As I noted earlier, it’s been my experience that most clients looking for a means to combine existing PowerPoint shows with Director need end-users to have the capability of modifying those shows for their specific needs.

It’s possible to create a Director interface resembling the PowerPoint environment allowing user changes to text, graphics and even transitions, but, as one of my favorite quotes from DIRECT-L has it, the fact that it's possible to wear a toilet bowl as a hat doesn't mean that it's desirable. The required effort could easily become a daunting (and budget-breaking) task. How much easier if the PowerPoint show was simply a linked, external file that could be modified as needed through PowerPoint itself and then displayed through a Director interface.

Apparently no significant changes have been made to the PowerPoint Import Xtra in Director 7, and I suspect most developers will continue to need to find more viable alternatives than using the Xtra.

Why the "Open" Command Isn't Enough

The simplest method to display a PowerPoint show from a Director movie is to use the Lingo "open [whichDocument] with [whichApplication]" command. In this case, [whichDocument] being the name of the PowerPoint file, and [whichApplication] being either PowerPoint itself or the Viewer.

Upon invoking the command, Director will launch the named file using the designated application. Of course, the programmer first needs to address such issues as locating PowerPoint or the Viewer, installing the Viewer if necessary, and establishing pathnames.

It's worth noting that out of all the major Viewer applications (Acrobat, Excel, PowerPoint, and Word each have their unique viewers), only the PowerPoint Viewer requires installation on the end-user's hard drive in order to work properly. The other Viewer applications can be run from a CD drive, sparing the end-user’s hard drive disk space.

Projectors created with versions of Director earlier than 6 tended to crash in low-memory situations when launching applications with the "open" command. A number of third-party utilities were developed to address this issue. Bruce Epstein's zLaunch, for example, can be used to quit out of the Projector, launch an application, and then automatically relaunch the Projector when the user exits the application.

Either changes made to Director or the fact that most PCs now have at least 32 MB RAM seems to have tempered the problem. While I’d still recommend testing extensively on minimum configurations, I've found the "open" command can be used to launch PowerPoint shows without problems in most situations.

But, a serious issue still remains. Opening a new application means the audience will leave the Director interface. Many will find the transition between interfaces jarring. Many clients will be unhappy with the time needed to launch the new application. As a developer, you may hate to see your elegant Director interface replaced by a full-screen PowerPoint presentation created by an amateur designer.

Since the PowerPoint Viewer dynamically takes over the entire display, your audience may not realize that the Director interface is still running, and think they've exited your program. Even when the user understands that the programs are running simultaneously, a common response in the Windows environment is to ALT-TAB between the two windows rather than Exit from one or the other, which may not be desirable from your perspective. A utility such as zLaunch can address these issues, but you or your client may not be happy with the amount of time needed to exit and relaunch the executables.

Using the "open" command does give end-users the ability to modify external PowerPoint shows that can then be launched from Director, but a much better solution would be to "embed" the PowerPoint show as a controllable, sizable window within the Director interface. This gives the developer control over the audience’s experience, while still giving end-users the ability to customize PowerPoint shows.

Getting Warmer: The ActiveX Control Xtra

I've found the ActiveX Control Xtra that’s been included with Director since 6.5 a much more useful utility than the PowerPoint Import Xtra. One of the ActiveX Control Xtra’s best features is the capability it provides to display an Internet Explorer browser window within a Director interface.

While poorly and confusingly documented, a fault it has in common with many Macromedia products, it’s easy to use the ActiveX control to create a browser window.

You first need to have Internet Explorer 3 or 4 installed on your machine. Given that you have the browser installed, select "Control", "ActiveX" from the "Insert" menu in Director and a list of all registered ActiveX controls appear. Scroll down the list until you find "Microsoft Web Browser" and select it. The control is placed in the cast, and its menu appears.

Place the cast member on Stage as Sprite 1 and place the following script in an exitFrame handler:

navigate (sprite 1, "name" )
pause

where "name" is the URL of the document you want opened. For example, if you have an open Internet connection, you could use http://www.quantic.com to display the home page of my company's site. Just as with IE, the URL can be a local or Internet document.

A surprisingly under-used feature of IE is its ability to display other ActiveX-aware documents, including Word, Excel, and yes, PowerPoint. As an example, create a sample movie using the ActiveX control as I've described above. Create a sample PowerPoint show (I'm assuming that the interest shown in your getting to this point of the article means that you have a copy of PowerPoint), and save the sample show to the same directory as your sample movie.

Change the Lingo to:

navigate (sprite 1, the pathName & "the file name of your PowerPoint show " )
pause

and run the movie. You'll see the browser window open the PowerPoint show. Note that animation, interactivity, and so on in the show remains intact.


An example using the ActiveX Control Xtra and IE 3

I've successfully used the ActiveX control on projects not only to display PowerPoint files, but also Word documents and Excel spreadsheets. However, it’s not a perfect solution by any means. End-user machines must have properly registered and configured versions of both IE and PowerPoint installed. There are different browser controls for IE 3 and 4. The "Viewers" option of IE must be set to use PowerPoint. In other words, the list of potential pitfalls is large.

But in projects where the end-user environment is either known or can be dictated by the developer, the ActiveX control will elegantly integrate a PowerPoint show within a Director interface. However, if you can't be sure that your audience will have both IE and PowerPoint then it’s time to find a Buddy.

How I found Happiness with Buddy API

With due reason, Gary Smith’s Buddy API Xtra is generally acknowledged as one of the (if not the) most useful Xtras available to the Director developer community. It contains over 100 functions for dealing with the Windows API and Macintosh Toolbox. Included among these are the capabilities to launch other applications, to hide and resize windows, and to control external applications through simulation of keystrokes.

While I had been aware of Buddy API, I had never used it until I was in the process of developing my own ActiveX control. My idea was to develop a PowerPoint Viewer control that could be used similar to the way the Web browser control works with Director. The major difference between the two controls would be that the PPTView control (as we named it), would only require the freeware PowerPoint Viewer to be installed on end-user machines. Unlike the Web browser control, IE and PowerPoint would not be necessary.

My developers found it a relatively easy task to develop the PPTView control, and it worked perfectly with Director. Using the control, we could launch a show with the Viewer, return the number of slides, go to specific slides, and simply and easily change the show we were displaying.

However, we had one glaring problem. Unlike the Web browser control, we were unable to get the Viewer to display as a window within the Director interface. The Viewer persisted in opening the PowerPoint show as a full-screen window, as if we were still using the "open" command.

I started casting around for a means to resize the PowerPoint window, and to "overlay" that window on the Director interface, thinking (rightly, as it turned out) that we might be able to create the illusion that the show was "embedded" within the interface, similar to a Movie in a Window. I quickly discovered that Buddy API was the best solution for our needs.

Although the Xtra's sheer number of functions (its current documentation is over 100 pages) can be overwhelming to the new user, I eventually learned how to use Buddy API to locate the Viewer, launch a PowerPoint show, and display the show apparently embedded as a window within our Director interface.

Rather than fully replicate those steps here, I'll point you to an example recently posted on Smith's site. Although a Director 5 file, the example will work under 6 to show the basics of using Buddy API to display and control PowerPoint from Director.

Use of the Xtra’s "setWindowState" and and "moveWindow" commands allow you to open the window of a PowerPoint show (using the Viewer or PowerPoint itself) behind the Director window and resize it to your needs (for example, to a 320 x 240 size). Using the"setWindowState" command again will bring the PowerPoint window to the front, giving the illusion that the PowerPoint show is now "embedded" within the Director interface.


This example uses a combination of Quantic's ActiveX PPTView Control and the Buddy API Xtra to display PowerPoint in a window. Note that the slide count is returned under the window.

In fact, the Buddy API Xtra is so featured-packed that it eventually replaced the need for our ActiveX control altogether. I had originally thought that slide display functions (such as go to the next slide, go to a specific slide, and so on) were beyond Buddy API. However, Al Hospers of RockSolid Software shared with me a behavior he created for Buddy API that, among other things, demonstrates using the Xtra’s "sendKeys" function to control slide display.

Interestingly, Al and I were independently pursuing a solution to the same problem, how to synch a "talking head" video to a PowerPoint slide show within a Director interface. I addressed the problem with an ActiveX control combined with the Buddy API Xtra. Al figured out how to do it with Buddy API alone.

Admitting a certain bias as one of its developers, I still feel that Quantic’s PPTView control is far easier to use than Buddy API—especially if you’re not already familiar with the Xtra. Our control also does have the unique capability of returning the slide count of any presentation it opens (as can be seen in the image above). But the control’s lack of the key feature of controlling the show’s window functions means that Buddy API or a similar Xtra is also needed, and most developers will find that Buddy API alone answers their needs.

I think it’s unfortunate that Macromedia pursued the strategy of importing PowerPoint shows into Director, rather than figuring out how to link to external PowerPoint files as cast members. But with either the ActiveX Control Xtra or the Buddy API Xtra, the PowerPoint Viewer, and a little programming effort, anyone can still display and control an external PowerPoint show from within a Director movie, giving the seamless illusion of PowerPoint in a Window.

Update to "PowerPoint in a Window"

Many things have changed since my "Powerpoint in a Window" article was published on DOUG a few months ago. Given the interest that the article inspired (Zac tells me it was one of the most-accessed articles on DOUG, and I've received over 30 emails and even a few phone calls about it), I thought I'd provide a brief update.

Microsoft has released a PowerPoint Viewer for the Mac. Full information and the download can be found at:

http://www.microsoft.com/macoffice/productinfo/98dl/pptvdl.htm

I'm not sure if the Mac version of Buddy API and the Mac PowerPoint Viewer could be used in the same fashion as I describe for Windows to "embed" a PowerPoint show in a Mac Director movie, but it'd be an interesting experiment for someone to try.

Director 7.0 appears to have some type of conflict with the Microsoft ActiveX Web Browser control, causing a fatal crash when the ActiveX sprite is called more than once. I've had anecdotal reports that this bug does not occur with all versions of IE. However, I can consistently reproduce it using either IE 3 or IE 4.0.1. I recommend using Director 6.5 or waiting for the maintenance release of Director 7 if you're using the ActiveX Control strategy I outline in the article.

Finally Al Hospers has changed the name of his company, email, and site since the article was published. Go to Cambersoft at http://www.cambersoft.com/code/ppt_demo.html to see a much more technically-oriented article than mine, and, even better, a very elegant Director movie that demonstrates using Buddy API to "embed" a PowerPoint show in Director.

Fred Bals is a creative director at Quantic Communications, and promises to update his Web site Real Soon Now.

Copyright 1997-2017, Director Online. Article content copyright by respective authors.