improve:PPT联动

This commit is contained in:
2026-01-17 17:11:11 +08:00
parent 5d6f53dc58
commit 76babf4dd3
+4 -20
View File
@@ -291,18 +291,13 @@ namespace Ink_Canvas.Helpers
} }
return null; return null;
} }
catch (COMException ex) catch (COMException)
{ {
var hr = (uint)ex.HResult;
if (hr == 0x800401E3 || hr == 0x800401F3 || hr == 0x800401E4)
{
return TryConnectToPowerPointViaROT();
}
return null; return null;
} }
catch (InvalidCastException) catch (InvalidCastException)
{ {
return TryConnectToPowerPointViaROT(); return null;
} }
catch (Exception) catch (Exception)
{ {
@@ -337,24 +332,13 @@ namespace Ink_Canvas.Helpers
} }
return null; return null;
} }
catch (COMException ex) catch (COMException)
{ {
var hr = (uint)ex.HResult;
if (hr == 0x800401E3 || hr == 0x800401F3 || hr == 0x800401E4)
{
// WPS COM注册损坏,尝试使用ROT备用方法
return TryConnectToWPSViaROT();
}
if (hr != 0x80004005 && hr != 0x800706B5 && hr != 0x8001010E)
{
LogHelper.WriteLogToFile($"连接WPS失败: {ex}", LogHelper.LogType.Warning);
}
return null; return null;
} }
catch (InvalidCastException) catch (InvalidCastException)
{ {
// WPS COM对象类型转换失败,尝试使用ROT备用方法 return null;
return TryConnectToWPSViaROT();
} }
catch (Exception) catch (Exception)
{ {