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

HI i am new to tek-tips. my pro 2

Status
Not open for further replies.

presdes

Technical User
Apr 19, 2003
16
US
HI
i am new to tek-tips.
my problem is i am trying to open powerpoint show in visual basic. with the click of a button a show will start. i have already included the "powerpoint object library".
further more i have the following

Dim ppt As New PowerPoint.Application
ppt.ActivePresentation (App.Path /show.pps)

i just don't know how to go further.
can anyone help me

thank you
presdes
 
Here is one way:
Code:
Sub demo()
Dim ppt As New PowerPoint.Application
  ppt.Presentations.Open Filename:="c:\show.pps", ReadOnly:=True
  Set ppt = Nothing
End Sub
Welcome to Tek-Tips. Be sure to click the About Us link at the top of the screen and follow the "Company" links to see how it works here. (I don't work for Tek-Tips. I'm just a member, like you.)

 
hi Zathras

I have the following code. i changed it a bit:
i get the "Type mismatch error"
Does it matter if i am trying to open a powerpoint show rather than a presentation.

thank you
presdes

Dim ppt As New PowerPoint.Application
ppt.Presentations.Open FileName:=App.Path / "show.pps", ReadOnly:=True
Set ppt = Nothing
 
Hi presdes,

I run a Powerpointe show from a database I support. Below is the code format I use.

****************************begin*******
Sub showpwr()

Dim pr As PowerPoint.Presentation
Set pr = GetObject("C:\test.pps")
pr.SlideShowSettings.Run

End Sub

*****************end***************

Actually, the way I have it setup, the file could be a ppt. In the code, "Slideshowsettings" is set to "Run".

HTH

p.s. Welcome to Tek-Tips!!!

Have A Great Day!!!, [bigglasses]

Nathan
Senior Test Lead
 
Nathan, thanks for providing the answer. I don't use PP much and was scrambling to find an answer for presdes since there didn't seem to be anyone else around at the time.

presdes, you could use
Code:
  Set pr = GetObject(Application.Path + "\test.pps")
but I don't think it's a good idea to store your data in the same library that Microsoft uses to store the application .exe files.

 
I tried Nathan1967 code and it worked perfectly fine.
thank you Zathras and Nathan1967. your help is deeply appreciated.
thanks,

presdes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top