views:

727

answers:

4

I'm writing a little macro which will fire up a flash presentation. I'm using VBA to do this inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. Everything works GREAT but when I run this from a location whose path is a UNC path (\myserver\myfolder\sample.ppt) it does not work.

The ShellExecute routine expects 6 arguments, one of which is the path to run it from. I've tried to set this parameter to C:\ as well as using ActivePresentation.Path (which is a UNC path). Neither works.

Does anyone know if this ought to work?

A: 

UNC paths start with a double back-slash. Are you doing that, or was that just a typo in the question?

Jason Cohen
A: 

I've resorted to mapping a drive to the UNC path.

The command line looks something like

subst A: "\\ServerName\SomeDirectory"

Kevin Gale
that seems like a reasonable workaround. my only worry is on some systems users are, i think, not allowed the ability to map network drives. i am going to check this out though, it seems like it should work.
the0ther
A: 

well, now it seems to work just fine with the unc path.

the0ther
+2  A: 

I initially tried this approach, but found it caused problems:

  • When the presentation was used from a laptop not connected to the network.
  • If the user did not have access to the UNC.
  • If the flash file was renamed, moved or deleted.

I found a better approach was to embed the file into the Powerpoint file.

It can be done as follows using Office XP, Powerpoint

From the 'View' menu select 'Toolbars' and tick the 'Control Toolbox'

On the 'Control Toolbox' toolbar click on the 'More controls' icon

A list of controls will be displayed. Scroll down until you find the 'Shockwave Flash Object' and then click on it.

This should change your cursor to a crosshair. Move to the area on the slide where you want to inset the 'Shockwave Flash Object'. Left click, hold and drag to create a box of the required size.

Next right click on the control you have just inserted and select 'Properties'.

Set the following properties

* Autoload = True
* EmbedMovie = True
* Enabled = True
* Loop = True
* Playing = True
* Visible = True
* Movie = c:\flash.swf (Change this to the location of your .swf file)

Close the 'Properties' control

Save the file.

Close the file.

Reopen the file.

The .swf file should start playing automatically when you reach the slide during the slide show.

I found it usefull to include controls (pause/play, time line) in the .swf file

Robert Mearns
i have tried something like this a few years back. i found that there were some problems with the interplay between PowerPoint and Flash. Sometimes the flash just would not play. Sometimes it would. It was the sort of bug that I was never able to consistently reproduce it. Maybe it would works now.
the0ther