Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Script to launch powerpoint presentation

Posted on 2009-04-02
2
Medium Priority
?
1,058 Views
Last Modified: 2012-08-13
I ceated the follwing scrip to launch a powerpoint presentation for our marketing display workstations on startup by placing this script file into the startup group.  The problem is that the file name migh change so i was thinking of using the follwoing line for line 3 of the code Set Pres = PPT.Presentations.Open("C:\Test\*.ppt") but this fails.  Is there a way to run this sayingopen only the ppt presentation in the specifed folder.  We will only have one presentation in the folder at a time.
Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible=True
Set Pres = PPT.Presentations.Open("C:\Test\Test.ppt")

Open in new window

0
Comment
Question by:georgedschneider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Assisted Solution

by:jwarnken
jwarnken earned 1000 total points
ID: 24050427
This will work as long as there is only one ppt file in the folder
Dim fso, presFiles
presFolder = "C:\Test"
Set fso = CreateObject("Scripting.FileSystemObject")
Set presFiles = fso.GetFolder(presFolder)
For Each f In presFiles.Files 
	If Right(LCase(f.Name),3) = "ppt"Then presFile = f.Path
Next 
WScript.Echo presFile

Open in new window

0
 

Accepted Solution

by:
georgedschneider earned 0 total points
ID: 24054903
I added your script wiht the one i had previosuly to create the script below making it a little bit more dynamic by reading all fiels fin a folder for the one powerpoint presentation that needs to run.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set PPT = CreateObject("PowerPoint.Application")
objStartFolder = "C:\Test"
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
	If objfile.type = "Microsoft PowerPoint Presentation" then
	PPT.Visible=True
	Set Pres = PPT.Presentations.Open("C:\Test\Test.ppt")
	End If	
Next

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question