Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro to toggle between fullscreen
#4
This is macro A. Macro B will be simple.

Macro Macro1415
Trigger 3 /POWERPNT     Help - how to add the trigger to the macro
Code:
Copy      Help
;/exe 1

ifa "PowerPoint Slide Show" ;;in slideshow (fullscreen)
,;this code is for 3)
,int i=PowerPointSlidesGetCurrent(1)
,err i=PowerPointSlidesGetCount
,key Z ;;Esc to stop slideshow
,PowerPointSlidesSetCurrent i
else ;;in editor
,;this code is for 1) and 5)
,key SF5 ;;press Shift+F5 to start show from current slide

You need these functions.
Function PowerPointSlidesGetCurrent
Code:
Copy      Help
;/
function# [flags] ;;flags: 1 in slideshow

;Returns 1-based index of current slide in PowerPoint.
;Error if failed.
;By default, works in the main PowerPoint window (editor). If flag 1, works in the slideshow window (player).


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."

PowerPoint.Slide d
if(flags&1) d=ap.SlideShowWindows.Item(1).View.Slide
else d=ap.ActiveWindow.View.Slide

ret d.SlideIndex
err+ end ES_FAILED

Function PowerPointSlidesSetCurrent
Code:
Copy      Help
;/
function index [flags] ;;flags: 1 in slideshow

;Selects slide in PowerPoint.
;Error if failed.
;By default, works in the main PowerPoint window (editor). If flag 1, works in the slideshow window (player).

;index - 1- based slide index.


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."


if(flags&1) ap.SlideShowWindows.Item(1).View.GotoSlide(index -1)
else ap.ActiveWindow.View.GotoSlide(index)
;
err+ end ES_FAILED

Function PowerPointSlidesGetCount
Code:
Copy      Help
;/
function#

;Returns number of slides in PowerPoint.
;Error if failed.


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."

ret ap.ActivePresentation.Slides.Count

err+ end ES_FAILED


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)