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
 

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