habeebs
(Lurker)
2006-04-27 02:24 PM
Calling a pps presentation

Helo,

I have a problem while I try to call a pps presentation on my script login.

I tried, CALL, SHELL (plus call), RUN, DISPLAY and PLAY.
But the results were not good.

Could, please, someone help me in how call a pps presentation on kix script?

Thanks


Mart
(KiX Supporter)
2006-04-27 02:55 PM
Re: Calling a pps presentation

This work for me.

Code:

$key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe"
$path = ReadValue($key, "Path")

Run $path + "powerpnt.exe c:\file.ppt"



[edit]
I used a .ppt but a .pps also works.
[/edit]


Radimus
(KiX Supporter)
2006-04-27 03:56 PM
Re: Calling a pps presentation

run '%comspec% /c start '+ $pptfile

ChristopheM
(Hey THIS is FUN)
2006-04-27 04:27 PM
Re: Calling a pps presentation

take care to long file name.

I use to write
run '%comspec% /c start "'+ $pptfile +'"'


Richard H.Administrator
(KiX Supporter)
2006-04-27 04:37 PM
Re: Calling a pps presentation

The run/start method doesn't always work - for example it simply opens a command window for me. The same applies to ".htm" files that are not in my current directory.

If you can identify the application path and explicitly execute it you will find it is a more reliable solution for general deployment.


ShawnAdministrator
(KiX Supporter)
2006-04-27 05:00 PM
Re: Calling a pps presentation

Here is a way to do this using COM ...

Code:

Break On

$FILENAME = "e:\Presentation1.ppt"

$PowerPoint = CreateObject("Powerpoint.Application")

$Presentation = $PowerPoint.Presentations.Open($FILENAME,,,0)

$= $Presentation.SlideShowSettings.Run

Exit 0



Richard H.Administrator
(KiX Supporter)
2006-04-27 05:14 PM
Re: Calling a pps presentation

Quote:

Here is a way to do this using COM



Is that synchronous?


ShawnAdministrator
(KiX Supporter)
2006-04-27 05:16 PM
Re: Calling a pps presentation

Nope - asynchronous. Prolly could make it sync if required.

Les
(KiX Master)
2006-04-27 05:21 PM
Re: Calling a pps presentation

The FileAction() UDF can do it.

LonkeroAdministrator
(KiX Master Guru)
2006-04-27 08:18 PM
Re: Calling a pps presentation

yo, basta's...
what's wrong with:
run 'explorer "' + $file + '"'


NTDOCAdministrator
(KiX Master)
2006-04-27 09:12 PM
Re: Calling a pps presentation

Quote:

yo, basta's...
what's wrong with:
run 'explorer "' + $file + '"'




Because we don't live in a perfect World and sometimes other applications mess up or take over the file association.


NTDOCAdministrator
(KiX Master)
2006-04-27 09:32 PM
Re: Calling a pps presentation

I like Shawn's COM method myself, actually shows up as a presentation show instead of just opening PowerPoint like the file call method does.

Here is Mart's code a little different, both work well, but Shawn's does it a bit better (imho)
 
Dim $Msg
Run ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe','')+' '+
'\\server01\presentations\WELCOM~1.PPS'
If @ERROR
$Msg = MessageBox('There was an error running the presentation please contact support','No Presentation',16)
EndIf

 


LonkeroAdministrator
(KiX Master Guru)
2006-04-27 10:02 PM
Re: Calling a pps presentation

doc, on the other hand.
someone has default application for viewing some type of files and with your style of code you force them to ms appies instead.
tell me, I'm wrong...


NTDOCAdministrator
(KiX Master)
2006-04-27 10:45 PM
Re: Calling a pps presentation

Yes, quite true but in this case it would be highly unlikely that a user was not using PowePoint.

One could do a check on the association as well and see if it was even an associated file and to what application and then decide if you want to allow that application to run or if you're going to force another one.
 


JochenAdministrator
(KiX Supporter)
2006-04-28 03:45 AM
Re: Calling a pps presentation

Hey,

welcome to the wonderful world of KiXtart habeebs


mole
(Getting the hang of it)
2006-04-28 07:15 AM
Re: Calling a pps presentation

So many replies since Christophe's its old news now but I think:

Code:
 
run '%comspec% /c start "'+ $pptfile +'"'



... will open a command window because the Start command wants to interpret the string in the first set of quotes it finds as a title. The following will work:

Code:
 
run '%comspec% /c start '+'"Some PPT Show" '+'"'+$pptfile+'"'



mole


NTDOCAdministrator
(KiX Master)
2006-04-28 10:28 AM
Re: Calling a pps presentation

rofl, hehe

Boy we are bored. habeebs has not come back and replied and we're all trying to Golf and otherwise recode a simple task.


mole
(Getting the hang of it)
2006-04-28 05:37 PM
Re: Calling a pps presentation

Not much else to do while mole listens for his coffee to finish perking in the moring.

mole

PS - I hope the *.ppt file actually runs eventually after all this!


habeebs
(Lurker)
2006-04-28 07:24 PM
Re: Calling a pps presentation

Quote:

I like Shawn's COM method myself, actually shows up as a presentation show instead of just opening PowerPoint like the file call method does.

Here is Mart's code a little different, both work well, but Shawn's does it a bit better (imho)
 
Dim $Msg
Run ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe','')+' '+
'\\server01\presentations\WELCOM~1.PPS'
If @ERROR
$Msg = MessageBox('There was an error running the presentation please contact support','No Presentation',16)
EndIf

 




This one worked, BUT, it opened in power point, not a presentation.
I mean, I can edit it if I want after I login

And yes, I am reading the post, but while I test, I can't reply to you =p

Thanks


NTDOCAdministrator
(KiX Master)
2006-04-28 08:22 PM
Re: Calling a pps presentation

Yes, that's what I said. PowerPoint opens with the file association method.
If you use the code from Shawn though it will open correctly as a show.

Dim $FileName, $PowerPoint, $Presentation, $Nul
$FileName = '\\server01\presentations\WELCOM~1.PPS'
$PowerPoint = CreateObject('Powerpoint.Application')
$Presentation = $PowerPoint.Presentations.Open($FileName,,,0)
$Nul = $Presentation.SlideShowSettings.Run
Exit 0


LonkeroAdministrator
(KiX Master Guru)
2006-04-29 04:14 PM
Re: Calling a pps presentation

again, simple:
Code:

run "explorer yourpresentation.pps"



would work just fine.
don't think it too complex


Les
(KiX Master)
2006-04-29 05:23 PM
Re: Calling a pps presentation

Like I said... simple... open it with FileAction() and you have control over whether it opens for editing or show.

How hard can it be?


NTDOCAdministrator
(KiX Master)
2006-04-30 10:03 AM
Re: Calling a pps presentation

no one said it was hard, just everyone is so bored with not much going on with the board we're all blasting out ideas.


LonkeroAdministrator
(KiX Master Guru)
2006-04-30 08:09 PM
Re: Calling a pps presentation

doc, sure.
but habeeb took one of the longest codes represented and that's why I woe'd


Les
(KiX Master)
2006-04-30 08:24 PM
Re: Calling a pps presentation

This board is like a river full of hungry piranha...

Jooel,
What are you talking about? Habeebs didn't even reply until post #161345 and by then had his bones picked clean already.


LonkeroAdministrator
(KiX Master Guru)
2006-04-30 08:35 PM
Re: Calling a pps presentation

that I'm talking about.
he had huge amount of choices and he picked a long and complex one.
that's what I originally replied to where doc replied about something and then I replied to that and then you came back.
so...
ok.


ShawnAdministrator
(KiX Supporter)
2006-04-30 09:08 PM
Re: Calling a pps presentation

What makes you think Habeeb even picked one yet ?

Les
(KiX Master)
2006-04-30 09:13 PM
Re: Calling a pps presentation

You woe'd (yo'd actually) on post #161281, long before habeebs replied.

ShawnAdministrator
(KiX Supporter)
2006-04-30 10:15 PM
Re: Calling a pps presentation

Where da wooing ? I dunna see da wooing.

LonkeroAdministrator
(KiX Master Guru)
2006-04-30 10:56 PM
Re: Calling a pps presentation

I woe'd and yes, habeeb choce his/her pick when he/she posted a "working" solution, which was just a bit off.

and my woe was lot after that.
I started screaming after les started abusing me.


ShawnAdministrator
(KiX Supporter)
2006-04-30 11:20 PM
Re: Calling a pps presentation

Where's this working solution ? Habeebs has only ever posted twice - once to ask the question and once to complain one of the solutions didn't work.

Les
(KiX Master)
2006-04-30 11:27 PM
Re: Calling a pps presentation

pffft

LonkeroAdministrator
(KiX Master Guru)
2006-05-01 02:20 AM
Re: Calling a pps presentation

shawn:
Quote:


This one worked, BUT, ...




start reading the posts word by word as I do


NTDOCAdministrator
(KiX Master)
2006-05-01 04:54 AM
Re: Calling a pps presentation

Quote:

start reading the posts word by word as I do





ROFLMAO - Oh the humility not there in this post. How far must we stray from the truth when hi-jacking a post


habeebs
(Lurker)
2006-05-02 03:16 PM
Re: Calling a pps presentation

I just choose that one because was the one that worked...
I'm not accessing every time because I access on my job and I don't have free time to see it.
And I'm a man
LOL

Anyway, I'm trying all the methods that you all sugested me

Thanks

Edit:
By the way
run "explorer yourpresentation.pps"
didn't worked...

I will try the other way that is on last page.


habeebs
(Lurker)
2006-05-03 07:42 PM
Re: Calling a pps presentation

I gave up to use powerpoint, I saved the presentation in htm format and put to call IE, it's working fine and my boss liked.
Issue solved, thanks to you all =]