Jump to content

Hide a Powerpoint Presentation


Go to solution Solved by water,

Recommended Posts

Hi guys.

I want to open a .pptx presentation as a .pps (without change the extension)

Local $obj = ObjCreate("PowerPoint.Application")
Local $PresInterface = $obj.Presentations
Local $objPres = $PresInterface.Open(@ScriptDir & "\Presentacion.pptx")
$objPres.SlideShowSettings.Run()
$obj.visible = 0
; Waiting for user to close the window
Sleep(8000)
$obj.Quit()
Exit

I want to hide the powerpoint application before it has opened the presentation in fullscreen.

But the .visible=false dosn't work whereas MSDN says it's possible.

We intercepted a COM Error !

err.description is:     Application.Visible : Invalid request.  Hiding the application window is not allowed.
err.windescription: 
err.number is:  80020009

Have you got an idea why it's not allowed?

Another possibility which do the same thing :

On msdn forum, i found  this (VB): http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/e0c6bde2-ed02-42e1-87ed-36d56297fdea/

appPPT.Presentations.Open filename, WithWindow:=False

But can't manage to code this with AutoIt:

Local $objPres = $PresInterface.Open(@ScriptDir & "\Presentacion.pps","WithWindow:=false")

Someone has an idea?

Thx a lot in advance,

Tim

Link to comment
Share on other sites

Please search the Example Scripts forum for the PowerPoint UDF. Maybe there you'll find the function you need.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Solution

Could you please try this statement?

Local $objPres = $PresInterface.Open(@ScriptDir & "\Presentacion.pps", Default, Default, False)

Details can be found here.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Perfect Thanks a lot !!!

(That was the second option i spoke about, but my english is quite bad and i just didn't thought about that Default state...

For information, this is how to open a presentation file directly in fullscreen, you can also choose the width and height if u want to add it in your GUI.

$pps = FileOpenDialog("Choisissez votre présentation",@ScriptDir,"Presentations (*.pps;*ppt;*.pptx;*.ppsx;*.odp)|Tous (*.*)",1)
Local $obj = ObjCreate("PowerPoint.Application")

Local $PresInterface = $obj.Presentations
Local $objPres = $PresInterface.Open($pps, Default, Default, False)
$objPres.SlideShowSettings.Run()
;$obj.SlideShowWindows(1).Height = 250
;$obj.SlideShowWindows(1).Width = 250
$objPres.visible = 1


; Waiting for user to close the window
Sleep(8000)
$obj.Quit()
Exit
Edited by timmalos
Link to comment
Share on other sites

The problem is caused by AutoIt not supporting parameters by name as VB does.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...