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

vbscript for opening powerpoint templates from internet explorer

Status
Not open for further replies.

wickednz

Technical User
Nov 28, 2003
1
0
0
NZ
As part of a vbscript function I have the following for opening excel
and powerpoint documents:

elseif ucase(right(name,3)) = "XLS" or ucase(right(name,3)) = "XLT"
then

set exl = createobject("Excel.Application")
exl.visible = true
exl.Workbooks.add(name)
set exl = nothing

elseif ucase(right(name,3)) = "PPT" or ucase(right(name,3)) = "POT"
then

set pwrptApp = createobject("Powerpoint.Application")
pwrptApp.visible = true

'pwrptApp.Presentations.Open(name) 'Note: doesn't open templates as
new documents

pwrptApp.Presentations.add(name)
set pwrptApp = nothing



The problem I'm having is with the line
"pwrptApp.Presentations.add(name) " for opening powerpoint
presentations. If I use .add it only opens powerpoint with no document
loaded if I use .open it opens the presentation, but if it is a
template presentation (*.pot) it opens it as the template and not a
new presentation based on the template.


any help on this appreciated
thanks,
Robert
 
Powerpoint has an explicit method called ApplyTemplate you need to use.

pwrptApp.Presentations.add True 'fyi, there is no name parameter for this method
pwrptApp.ActivePresentation.ApplyTemplate name

See also:

Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top