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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating Powerpoint 1

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
I cannot seem to get Microsoft Powerpoint to open a freakn' powerpoint file. Here is the code

sub ViewPowerpoint(strHREF)

Dim strApp
strApp = "PowerPoint.Application"
On Error Resume Next
Set oApp = GetObject(, strApp)
if(oApp Is Nothing) then
Set oApp = CreateObject(strApp)
end if

oApp.Visible = True
oApp.Presentation.Open strHREF
Set oApp = Nothing
On Error Goto 0

end sub

This will open Powerpoint but it will not actually open the file like WORD and EXCEL do with virtually the same code. Any thoughts?

Thanks,
-bitwise
 
Hello, bitwise.

Should read :
oApp.Presentations.Open strHREF

Also, though not a factor of its not working, it is better to declare oApp as well, as one never knows what might be in the main, ie,
Dim strApp, oApp

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top