Starting PowerPoint from the Web using ActiveXObject

T

Tony B.

I'm trying to accomplish a few things via a web page which is causing me
some grief. I'll try to explain this as detailed as possible.

What I would like to do is be able to open a PowerPoint presentation from a
Web page hyperlink using the new ActiveXObject("PowerPoint.Application")
method. I could not find a way to do this using the ASP
[CreateObject("PowerPoint.Application")] method so I had to revert to using
JavaScript.

Before opening the presentation, I also want to add an addin (located on the
Web server) which includes an AutoOpen procedure to perform some initial
actions. I am able to create the object, add the addin to the Addins
collection, and open the presentation. However, the addin will not load. I
can use the debug features in VBA to verify the addin was added to the
collection. Even trying to load the addin manually in the Immediate window
will not work. My feeling is that the problem stems from permissions. I've
tried using the Web server's physical path to access the addinfile.ppa file
but this returns an error that the addin cannot be found. Using the http
address for the addinfile.ppa file adds the addin to the collection but will
not allow you to load it. Since the addin doesn't load, my AutoOpen
procedure never kicks off.

Here's the code I'm using:

<script language="JavaScript">
function startPowerPoint(strFile)
{
var myApp = new ActiveXObject("PowerPoint.Application");
if (myApp != null)
{

myApp.Addins.Add("http://www.myintranetsite.com/addindirectory/addinfile.ppa
");
myApp.Visible = true;
myApp.Presentations.Open(strFile);
}
}
</script>

I'm starting PowerPoint with a hyperlink like the one shown below:

<a
href="javascript:startPowerPoint('http://www.myintranetsite.com/presentation
s/test.ppt')">Test.ppt</a>

Also, if there is a way to programatically add and load an addin when
PowerPoint starts, this would also solve my problem.

Any help or suggestions are welcome.

Tony B
 
S

Shyam Pillai

Add-ins need to be local. If add-ins could be loaded in that manner, boy we
would have had a lot of fun.

Regards
Shyam
 
T

Tony B.

Since the instance of PowerPoint is ran locally, does this mean that I could
first use the FileSystemObject to grab a copy of the addin file and place it
locally in the user's C:\Temp directory, then add/load it, start PowerPoint,
do something, then remove the file when finished?

Thanks.
Tony B.

Shyam Pillai said:
Add-ins need to be local. If add-ins could be loaded in that manner, boy we
would have had a lot of fun.

Regards
Shyam

Tony B. said:
I'm trying to accomplish a few things via a web page which is causing me
some grief. I'll try to explain this as detailed as possible.

What I would like to do is be able to open a PowerPoint presentation from
a
Web page hyperlink using the new ActiveXObject("PowerPoint.Application")
method. I could not find a way to do this using the ASP
[CreateObject("PowerPoint.Application")] method so I had to revert to
using
JavaScript.

Before opening the presentation, I also want to add an addin (located on
the
Web server) which includes an AutoOpen procedure to perform some initial
actions. I am able to create the object, add the addin to the Addins
collection, and open the presentation. However, the addin will not load. I
can use the debug features in VBA to verify the addin was added to the
collection. Even trying to load the addin manually in the Immediate window
will not work. My feeling is that the problem stems from permissions. I've
tried using the Web server's physical path to access the addinfile.ppa
file
but this returns an error that the addin cannot be found. Using the http
address for the addinfile.ppa file adds the addin to the collection but
will
not allow you to load it. Since the addin doesn't load, my AutoOpen
procedure never kicks off.

Here's the code I'm using:

<script language="JavaScript">
function startPowerPoint(strFile)
{
var myApp = new ActiveXObject("PowerPoint.Application");
if (myApp != null)
{

myApp.Addins.Add("http://www.myintranetsite.com/addindirectory/addinfile.ppa
");
myApp.Visible = true;
myApp.Presentations.Open(strFile);
}
}
</script>

I'm starting PowerPoint with a hyperlink like the one shown below:

<a
href="javascript:startPowerPoint('http://www.myintranetsite.com/presentation
s/test.ppt')">Test.ppt</a>

Also, if there is a way to programatically add and load an addin when
PowerPoint starts, this would also solve my problem.

Any help or suggestions are welcome.

Tony B
 
S

Shyam Pillai

What does your add-in do? I would feel very anxious if some site were to
install and load an add-in without my knowledge.

Regards
Shyam Pillai


Tony B. said:
Since the instance of PowerPoint is ran locally, does this mean that I
could
first use the FileSystemObject to grab a copy of the addin file and place
it
locally in the user's C:\Temp directory, then add/load it, start
PowerPoint,
do something, then remove the file when finished?

Thanks.
Tony B.

Shyam Pillai said:
Add-ins need to be local. If add-ins could be loaded in that manner, boy we
would have had a lot of fun.

Regards
Shyam

Tony B. said:
I'm trying to accomplish a few things via a web page which is causing
me
some grief. I'll try to explain this as detailed as possible.

What I would like to do is be able to open a PowerPoint presentation from
a
Web page hyperlink using the new
ActiveXObject("PowerPoint.Application")
method. I could not find a way to do this using the ASP
[CreateObject("PowerPoint.Application")] method so I had to revert to
using
JavaScript.

Before opening the presentation, I also want to add an addin (located
on
the
Web server) which includes an AutoOpen procedure to perform some
initial
actions. I am able to create the object, add the addin to the Addins
collection, and open the presentation. However, the addin will not
load. I
can use the debug features in VBA to verify the addin was added to the
collection. Even trying to load the addin manually in the Immediate window
will not work. My feeling is that the problem stems from permissions. I've
tried using the Web server's physical path to access the addinfile.ppa
file
but this returns an error that the addin cannot be found. Using the
http
address for the addinfile.ppa file adds the addin to the collection but
will
not allow you to load it. Since the addin doesn't load, my AutoOpen
procedure never kicks off.

Here's the code I'm using:

<script language="JavaScript">
function startPowerPoint(strFile)
{
var myApp = new ActiveXObject("PowerPoint.Application");
if (myApp != null)
{

myApp.Addins.Add("http://www.myintranetsite.com/addindirectory/addinfile.ppa
");
myApp.Visible = true;
myApp.Presentations.Open(strFile);
}
}
</script>

I'm starting PowerPoint with a hyperlink like the one shown below:

<a
href="javascript:startPowerPoint('http://www.myintranetsite.com/presentation
s/test.ppt')">Test.ppt</a>

Also, if there is a way to programatically add and load an addin when
PowerPoint starts, this would also solve my problem.

Any help or suggestions are welcome.

Tony B
 
T

Tony B.

Since we have a closed network, the only individuals that have access to the
Intranet are a select group. We currently store daily presentations (.png
format) on our Intranet. Each presentation provides a "download source"
link which allows the user to open/download the source presentation used to
generate the customized .png version of the presentation with slide notes
(we built an export utility to handle this).

I have been tasked to provide a means of generating a source presentation
without actually storing one on the server. We have written the necessary
code to create the source from the exported .png files/slide notes. This is
the code that resides in the AutoOpen procedure of the addin, which will run
automatically once I figure out how to load the addin programmatically. The
presentation that actually opens from the hyperlink is a blank presentation
and will run in the background until the source presentation is built. It's
really only a placeholder.

If there is a way to have the blank presentation programmatically add and
load the addin, this would solve my problem? I have tried this but VBA
gives me an error that I can't run this code outside of a procedure. I've
seen examples on the Web of people doing this in PowerPoint but I must be
doing something wrong.

Hope this helps.

Shyam Pillai said:
What does your add-in do? I would feel very anxious if some site were to
install and load an add-in without my knowledge.

Regards
Shyam Pillai


Tony B. said:
Since the instance of PowerPoint is ran locally, does this mean that I
could
first use the FileSystemObject to grab a copy of the addin file and place
it
locally in the user's C:\Temp directory, then add/load it, start
PowerPoint,
do something, then remove the file when finished?

Thanks.
Tony B.

Shyam Pillai said:
Add-ins need to be local. If add-ins could be loaded in that manner,
boy
we
would have had a lot of fun.

Regards
Shyam

I'm trying to accomplish a few things via a web page which is causing
me
some grief. I'll try to explain this as detailed as possible.

What I would like to do is be able to open a PowerPoint presentation from
a
Web page hyperlink using the new
ActiveXObject("PowerPoint.Application")
method. I could not find a way to do this using the ASP
[CreateObject("PowerPoint.Application")] method so I had to revert to
using
JavaScript.

Before opening the presentation, I also want to add an addin (located
on
the
Web server) which includes an AutoOpen procedure to perform some
initial
actions. I am able to create the object, add the addin to the Addins
collection, and open the presentation. However, the addin will not
load. I
can use the debug features in VBA to verify the addin was added to the
collection. Even trying to load the addin manually in the Immediate window
will not work. My feeling is that the problem stems from permissions. I've
tried using the Web server's physical path to access the addinfile.ppa
file
but this returns an error that the addin cannot be found. Using the
http
address for the addinfile.ppa file adds the addin to the collection but
will
not allow you to load it. Since the addin doesn't load, my AutoOpen
procedure never kicks off.

Here's the code I'm using:

<script language="JavaScript">
function startPowerPoint(strFile)
{
var myApp = new ActiveXObject("PowerPoint.Application");
if (myApp != null)
{
myApp.Addins.Add("http://www.myintranetsite.com/addindirectory/addinfile.ppa
");
myApp.Visible = true;
myApp.Presentations.Open(strFile);
}
}
</script>

I'm starting PowerPoint with a hyperlink like the one shown below:

<a
href="javascript:startPowerPoint('http://www.myintranetsite.com/presentation
s/test.ppt')">Test.ppt</a>

Also, if there is a way to programatically add and load an addin when
PowerPoint starts, this would also solve my problem.

Any help or suggestions are welcome.

Tony B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top