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
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