Sign in to follow this  
Followers 0
timmalos

Hide a Powerpoint Presentation

7 posts in this topic

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

Share this post


Link to post
Share on other sites



WinSetState("Power Point", "", @SW_HIDE)

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The WinSetStage function dosn't work as Powerpoint is seen one half second, and there is nothing in the UDF powerpoint, my script comes from it.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • Aphotic
      By Aphotic
      Just wanted to share my functions for managing a GUI with lots of controls and many screens.
      I personally feel that it is very efficient and keeps line count to a minimum.
      And if it's not, I'll learn a better solution!
      Note: There are some conditional veriables such as $changes and $cont that are modified by the main loop in this particular script; they are meant as an example, please don't try too hard to understand why they're used.
      *Usage*
      This allows you to re-state a handful of buttons in one line when doing slight GUI changes:
      ToggleCTRL($GUI_DISABLE, $dALO, $dAAF, $dRLA) (A few buttons on a certain screen)
      ToggleCTRL($GUI_DISABLE, $dSAV, $dCAN) (Save/Cancel buttons)
      AND
      A single line solution to switching a GUI "screen":
      GuiMod("MAIN", $GUI_HIDE)
      GuiMod("DETAILS", $GUI_SHOW)
      GuiMod("PLANS", $GUI_HIDE)
      Another way I've used this to my advantage is as follows:
      Say a GUI has 3 or 4 main screens, and 3 or 4 "form" screens.
      When switching to a form screen, save the main screen that it was on to a variable; then once the user is done with the form, either submitting or cancelling, you can call the variable to revert back to the main screen it was on.
      Func _GuiMod($i, $tog, $act = True) Switch $i Case "MAIN" If $tog = $GUI_SHOW And $changes Then $changes = False ControlClick($GUI, "", $LOGfg) Else EndIf If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 535, 445) _ToggleCTRL($tog, $TAB, $LOGfl, $LOGfc, $LOGfi, $LOGfg, $LOGta, $LOGvd) _ToggleCTRL($tog, $LOGtp, $LOGse) Case "DETAILS" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 535, 475) Local $cont = True If $tog = $GUI_SHOW And $act Then If Not UpdateDetails() Then $cont = False _GuiMod("MAIN", $GUI_SHOW) EndIf EndIf If $cont Then _ToggleCTRL($tog, $dUID, $dICU, $dACC, $dCOF, $dNAM, $dCO2, $dIPW, $dEMA, $dEDI, $dLOG, $dMOD) _ToggleCTRL($tog, $dUPD, $dINP, $dAPL, $dALO, $dAAF, $dPLL, $dLOL, $dAFL, $dSAV, $dCAN, $dRPL) _ToggleCTRL($tog, $dRLA, $dACT, $dAC2, $dRET, $dDEL, $dADD, $dMQC) EndIf Case "ADD-INPUT" _ToggleCTRL($tog, $nCOMi, $nCO2i, $nNAMi, $nNAMb, $nEMAi, $nPREc, $nACCc, $nICUi, $nADDi, $nNOTi) _ToggleCTRL($tog, $nAPLb, $nALOb, $nAAFb, $nPLAl, $nLOCl, $nAFFl, $nRPLb, $nRLAb, $nADDb, $nCLEb) Case "PLANS" If $tog <> $GUI_SHOW Or Not $changing Then If $act Then _ToggleCTRL($tog, $dMOD, $dLOG, $dUPD, $dDEL) _ToggleCTRL($tog, $dINP, $dAPL, $dALO, $dAAF, $dPLL, $dLOL, $dAFL, $dSAV, $dCAN, $dRPL, $dRLA) EndIf Case "CHANGE" _ToggleCTRL($tog, $dITL, $dITC, $dAML, $dAMC, $dSCB, $dCCB, $dEAB) If $tog = $GUI_SHOW Then GUICtrlSetState($dRET, $GUI_DISABLE) Else GUICtrlSetState($dRET, $GUI_ENABLE) EndIf Case "NEW" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 465, 475) _ToggleCTRL($tog, $TAB, $nCOMl, $nCOMi, $nCO2l, $nCO2i, $nNAMl, $nNAMi, $nEMAl, $nEMAi, $nPREl, $nPREc) _ToggleCTRL($tog, $nACCl, $nACCc, $nPAEb, $nICUl, $nICUi, $nADDi, $nAPLb, $nALOb, $nAAFb, $nPLAl, $nLOCl) _ToggleCTRL($tog, $nAFFl, $nRPLb, $nNOTl, $nNOTi, $nADDb, $nCLEb, $nLAST) Case "ACCESS" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 465, 330) _ToggleCTRL($tog, $ACCd1, $ACCd2, $TYPla, $TYPli, $TYPad, $TYPde, $TYPmu, $TYPmd, $ACCla, $ACCli) _ToggleCTRL($tog, $ACCde, $ACCmu, $ACCmd, $ACCdl, $ACCdi, $ACCal, $ACCai, $ACCaa, $taRET) Case "TPi" _ToggleCTRL($tog, $tpOPEb, $tpCREr, $tpLINr, $tpCO2i, $tpEMAi, $tpEMAl, $tpCREb, $tpCOPb, $tpCOPi, $tpCTOi, $tpCGOb) _ToggleCTRL($tog, $tpUFLi, $tpUFLb, $tpICUi, $tpPLAi, $tpLINb, $tpDLIb, $tpUFMi, $tpSCAl, $tpCFAr, $tpCBAr) Case "TPC" If $tog = $GUI_SHOW Then _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpCO2l, $tpCO2i, $tpCOPl, $tpCOPi, $tpCREb, $tpCOPb, $tpSEPl, $tpCTOl, $tpCTOi, $tpCGOb, $tpLAST) _ToggleCTRL($tog, $tpIDNl, $tpIDNi, $tpIDNn, $tpSCAl, $tpEMAi, $tpEMAl, $tpCFAr, $tpCBAr) Case "TPL" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpUFLl, $tpUFLi, $tpUFLb, $tpICUl, $tpICUi, $tpPLAl, $tpPLAi, $tpLINb, $tpDLIb, $tpUFMl, $tpUFMi, $tpIMAb, $tpIMRb) Case "TPH" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpUFLl, $tpUFLi, $tpUFLb, $tpUFMl, $tpUFMi, $tpCOCl, $tpCOCi, $tpCOGb) Case "TPD" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpDIDl, $tpDIDi, $tpDIDb) EndSwitch EndFunc Func _ToggleCTRL($tog, $c0 = 0, $c1 = 0, $c2 = 0, $c3 = 0, $c4 = 0, $c5 = 0, $c6 = 0, $c7 = 0, $c8 = 0, $c9 = 0, $c10 = 0, $c11 = 0, $c12 = 0) For $i = 0 To @NumParams GUICtrlSetState(Eval("c" & $i), $tog) Next EndFunc  
    • Darknightx37
      By Darknightx37
      Hay there i try to create a gui and delete them on my secound monitore when i was in a fullscreen application but i noticed that i got tabed out of the application every time i created a new gui
      how to fix that i get tabed out i already tryed with winsetontop("application", "", 1)
      thx
       
      --> @SW_SHOWNOACTIVATE
      sry im stupid
    • zxtnt09
      By zxtnt09
      Hi guys,
      i need to "hide" a process for "10 secounds " after show that up again ,
      my process is "CMD.exe" , i used " echo off " but it doesn't hide ( go minimized , etc ).
      i want to do that , something like that : 
      1 ) run > cmd.exe
      2 ) something write in cmd , like : ping google.com
      3 ) when (2) is running , i don't like it was show , i want hide that ( or minimize )
      4 ) back to show after "10 sec" 
      thanks, 
       
    • zxtnt09
      By zxtnt09
      Hi guys,
      i have problem with this : 


      #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUI() Func GUI() Global $MyForm = GUICreate("My GUI edit",500,300,100,100) GUISetState(@SW_SHOW) GUISetFont(12, 400, 0, "Tahoma") $Label1 = GUICtrlCreateLabel("Label 01 ",0, 0, 50 , 25 ) $Label1 = GUICtrlCreateLabel("Label 01 ",0, 50, 50 , 25 ) Global $BTN1 = GUICtrlCreateButton("BTN 1 ", 150, 0, 50, 25) Global $BTN2 = GUICtrlCreateButton("BTN 2", 150, 50, 50, 25) EndFunc ;Function Func Test1() If $BTN1 = True Then Local $Edit1 = GUICtrlCreateEdit("Edit 1", 0, 80, 200, 200) EndIf EndFunc Func Test2() If $BTN2 = True Then Local $Edit2 = GUICtrlCreateEdit("Edit 2", 200, 80, 200, 200) EndIf EndFunc While 1 Switch GUIGetMsg() Case $BTN1 If $BTN1 = True Then Test1 () EndIf Case $BTN2 If $BTN2 = True Then Test2 () EndIf Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd * i want to : after click on "$BTN 1" , "$Edit2" was hidden or 
      after click on "$BTN 2" , "$Edit1" was hidden.
    • RaiNote
      By RaiNote
      Hi,
      would there be a way to hide the Process Name in the Taskmanager and other programs which detects processes?
      or to Change the Name of the process but not of the exe~