fix:PPT上次页数记忆跳转

This commit is contained in:
2025-10-18 16:41:55 +08:00
parent a889041896
commit a1fccc2905
2 changed files with 34 additions and 6 deletions
+16 -5
View File
@@ -678,14 +678,25 @@ namespace Ink_Canvas.Helpers
{
try
{
if (!IsConnected || !IsInSlideShow || PPTApplication == null) return false;
if (!IsConnected || PPTApplication == null) return false;
if (!Marshal.IsComObject(PPTApplication)) return false;
var slideShowWindow = PPTApplication.SlideShowWindows[1];
if (slideShowWindow?.View != null)
if (IsInSlideShow && PPTApplication.SlideShowWindows.Count >= 1)
{
slideShowWindow.View.GotoSlide(slideNumber);
return true;
var slideShowWindow = PPTApplication.SlideShowWindows[1];
if (slideShowWindow?.View != null)
{
slideShowWindow.View.GotoSlide(slideNumber);
return true;
}
}
else if (CurrentPresentation != null)
{
if (CurrentPresentation.Windows?.Count >= 1)
{
CurrentPresentation.Windows[1].View.GotoSlide(slideNumber);
return true;
}
}
return false;
}