简体   繁体   中英

Handle PowerPoint Presenter View object Events programmatically in Vb.net

在此处输入图片说明 I created Add-In for PowerPoint which is working great in single screen but I need to use now double screen (Extended Mode) which has some issues and In my Add-In of PowerPoint, How can I handle the events of Presenter View Objects in Vb.net? lets suppose I want to control the events of these objects in presenter view pointed by red rectangles.

I want that when user click on presenter view object so my code should run rather than PowerPoint code.

Could someone please tell me how can I handle or can refer link.

Can you make use of any of these events: (sorry, I only have the VBA function declarations to hand)

SlideShowBegin (2013, 2010, 2007, 2003, 2002, 2000)

Application SlideShowBegin(ByVal Wn As SlideShowWindow)

Occurs when a slide show starts. Is called for each slide show that starts.

SlideShowEnd (2013, 2010, 2007, 2003, 2002, 2000)

Application SlideShowEnd(ByVal Pres As Presentation)

Occurs when a slide show ends. Is called for each slide show that ends.

SlideShowNextBuild (2013, 2010, 2007, 2003, 2002, 2000)

Application SlideShowNextBuild(ByVal Wn As SlideShowWindow)

Occurs after the next build starts.

SlideShowNextSlide (2013, 2010, 2007, 2003, 2002, 2000)

Application SlideShowNextSlide(ByVal Wn As SlideShowWindow)

Occurs after showing the new slide.

SlideSelectionChanged (2013, 2010, 2007, 2003, 2002)

Application SlideSelectionChanged(ByVal SldRange As SlideRange)

Occurs after a slide or slide selection changes in any view except the Outline view.

SlideShowNextClick (2013, 2010, 2007, 2003, 2002)

Application SlideShowNextClick(ByVal Wn As SlideShowWindow, ByVal nEffect As Effect)

Occurs after the slide show window is clicked.

SlideShowOnNext (2013, 2010, 2007)

Application SlideShowOnNext(ByVal Wn As SlideShowWindow)

Occurs when the slide show navigates through next build within the current slide.

SlideShowOnPrevious (2013, 2010, 2007)

Application SlideShowOnPrevious(ByVal Wn As SlideShowWindow)

Occurs when the slide show navigates through previous build within the current slide.

You can add event handler like you do in regular .Net applications.

Take a look at the How to handle PowerPoint events by using Visual Basic .NET 2003 article which explains how to handle Microsoft Office PowerPoint events by using Microsoft Visual Basic .NET. The sample code is included.

    'Start PowerPoint and then make the PowerPoint window visible but minimized.
    oApp = New PowerPoint.Application

    'Add event handlers.
    AddHandler oApp.SlideShowBegin, AddressOf oApp_SlideShowBegin
    AddHandler oApp.SlideShowNextSlide, AddressOf oApp_SlideShowNextSlide
    AddHandler oApp.PresentationClose, AddressOf oApp_PresentationClose

    'Event Handlers

    Private Sub oApp_SlideShowBegin(ByVal Wn As Microsoft.Office.Interop.PowerPoint.SlideShowWindow)

    End Sub

    Private Sub oApp_SlideShowNextSlide(ByVal Wn As Microsoft.Office.Interop.PowerPoint.SlideShowWindow)

    End Sub

    Private Sub oApp_PresentationClose(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation)


    End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM