Closed DominikPalo closed 4 years ago
EApplication.SlideShowBegin() method handles the PowerPoint event SlideShowBegin
and invokes the event handler method in user code.
SlideShowBegin event has single parameter of type SlideShowWindow.
This is incorrectly defined in NetOffice code as parameter of type DocumentWindow. Because of this type mismatch, there is internal exception and the event handler is not fired.
System.ArgumentException: 'Object of type 'NetOffice.PowerPointApi.DocumentWindow' cannot be converted to type 'NetOffice.PowerPointApi.SlideShowWindow'.'
mscorlib.dll!System.RuntimeType.TryChangeType(object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, bool needsSpecialCast)
mscorlib.dll!System.RuntimeType.CheckValue(object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr)
mscorlib.dll!System.Reflection.MethodBase.CheckArguments(object[] parameters, System.Reflection.Binder binder, System.Reflection.BindingFlags invokeAttr, System.Globalization.CultureInfo culture, System.Signature sig)
Line 126 : > NetOffice.dll!NetOffice.Events.CoClassEventReflector.RaiseCustomEvent(NetOffice.ICOMObject instance, System.Type type, string eventName, ref object[] paramsArray)
Line 1108: PowerPointApi.dll!NetOffice.PowerPointApi.Application.RaiseCustomEvent(string eventName, ref object[] paramsArray)
Line 383: PowerPointApi.dll!NetOffice.PowerPointApi.Events.EApplication_SinkHelper.SlideShowBegin(object wn)
Should be fixed in 1.7.4.7
https://www.nuget.org/packages/NetOfficeFw.PowerPoint/1.7.4.7
Thanks for fixing, I've just tried the version 1.7.4.7 - the SlideShowBeginEvent
is firing, but there is another issue: The SlideshowWindow
parameter passed to the SlideShowBeginEvent
and SlideShowNextSlideEvent
is now null (was ok in 1.7.3.1)
I found the problem, here is the fix https://github.com/NetOfficeFw/NetOffice/pull/266
Yeah, I am sorry I missed that. I checked the event was firing and I forget to check the parameters.
Try the 1.7.4.8
I added unit tests for SlideShowBegin, SlideShowNextBuild and SlideShowNextSlide to make sure the objects passed to the event handlers are correct.
I've just updated the NuGet package form version 1.7.3.1 to the latest version - 1.7.4.6 and the event
ActivePowerPointApp.SlideShowBeginEvent
is no longer fired when the PowerPoint switches to the SlideShow mode. Other events, likeActivePowerPointApp.WindowActivateEvent
,ActivePowerPointApp.SlideShowEndEvent
work as expected. I also tried the version 1.7.4.1 with no success - the last version where this event was working was 1.7.3.1.