07-12-2010, 06:02 AM
This is macro A. Macro B will be simple.
Macro Macro1415
Trigger 3 /POWERPNT
You need these functions.
Function PowerPointSlidesGetCurrent
Function PowerPointSlidesSetCurrent
Function PowerPointSlidesGetCount
Macro Macro1415
Trigger 3 /POWERPNT

;/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 slideYou need these functions.
Function PowerPointSlidesGetCurrent
;/
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_FAILEDFunction PowerPointSlidesSetCurrent
;/
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_FAILEDFunction PowerPointSlidesGetCount
;/
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