Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i open a link (HREF) to ".ppt" in Microsoft powerpont presentat 1

Status
Not open for further replies.

raj2134

Programmer
Jul 9, 2001
2
SG
I have a HTML page, from where I have links to power point
(.ppt) files. When I am clicking on the link. Its opening the powerpoint file
in IE itself (i can't go for netscape). I want to invoke MS-Powerpoint, so that the file is opened in MS-PowerPoint
application (this will help me executing few macros that have been written
in powerpoint)
 
Hello,
It is possible with MS Office Automation.
The code bellow is a skeleton for such task.
VBScript is a little bit easier. You could do similar things also with JavaScript.
The code will warn you for security issues, because you will try to access an object in users file system.

<html>
<head>
<title>PPT</title>
<script language=&quot;VBScript&quot;>
Sub showPPT(pptfile)
Dim ppApp

Set ppApp = CreateObject(&quot;PowerPoint.Application&quot;)
'There are objects from MS Office to which
'you have access:
'Word.Application
'Excel.Application
'PowerPoint.Application

'VBS function CreateObject is used to create
'an object of the type specified in the argument.
'See
ppApp.Visible = True
'There are number of properties of
'PowerPoint.Application
'Visible makes the app visible
'Presentations contains collection of pres in PPT

ppApp.Presentations.Open(pptfile)
'Open is a method for opening an existing presentation
'Add is a method for adding new empty pres
End Sub
</script>
</head>
<body>
<a href=&quot;#&quot; onclick='showPPT(&quot;C:\PPTS\test.ppt&quot;)'>PPT</a>
</body>
</html>

For more help with PowerPoint Automation
see .chm file on your computer:
C:\Program Files\Microsoft Office\Office\1033\VBAPPT9.CHM

Hope this helps.
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top