AxMath插件在PPT中弹窗警告

AxMath插件在PPT中弹窗警告

问题描述

当打开PPT软件时提示:

抱歉 由于某种原因,PowerPoint无法加载C:\ProgramData\Microsoft\AxMath.ppam加载项。

点击【确定】后,虽然可以正常使用AxMath软件,但是每次启动PPT都需要点击确定,很不方便

问题原因

  1. 可能原因为注册表中找不到对应路径文件
  2. 卸载安装过程中没有卸载干净,第二次安装时没有删除上次残留注册表信息

解决方法

  1. 输入组合键 Windows徽标键 + R 弹出运行窗口中输入:regedit 后回车或按【确定】启动注册表编辑器
  1. 打开如下注册表目录(需要更改两条注册表)
  1. 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office
  2. 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\PowerPoint\AddIns\AxMath
  1. 可以看到有好多的版本号与 PowerPoint 以及加载项 AxMath
  1. 依次查找 AxmathPath 数值名称与数值数据
  1. 在我自己的电脑中查找到数值数据

C:\ProgramData\Microsoft\AxMath.ppam

但在本地电脑中找不到该文件,原因就是在这里,故选择替换该数值数据

将注册表值替换为本地AxMath.ppam文件地址即可
在我的电脑上AxMath安装路径为

C:\Program Files (x86)\AxMath\MSOffice

可以看到安装路径里面有下列文件

建议在删除注册表前备份该注册表,谨慎删除、修改等

同样在以下注册表中替换对应的数值数据

计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\PowerPoint\AddIns\AxMath

退出注册表重新 PPT 启动,可以看到弹窗消失,问题解决。
同理,当遇到其他加载项无法加载时,也需要查找注册表,看路径是否有效。


注意 删除注册表前请备份、请备份、请备份!


参考

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以使用Microsoft.Office.Interop.PowerPoint命名空间的类来实现在WPF窗口播放PPT。具体步骤如下: 1. 添加对Microsoft.Office.Interop.PowerPoint的引用。 2. 在WPF窗口添加一个WindowsFormsHost控件。 3. 在WindowsFormsHost控件添加一个AxHost控件,并将其类型设置为Microsoft.Office.Interop.PowerPoint.Presentation。 4. 在窗口加载事件,使用Microsoft.Office.Interop.PowerPoint.Application类加载PPT文件。 5. 在AxHost控件的CreateControl方法,使用Microsoft.Office.Interop.PowerPoint.SlideShowSettings类设置PPT的播放方式。 下面是示例代码: ```C# using System.Windows.Forms.Integration; using Microsoft.Office.Interop.PowerPoint; //添加引用:Microsoft.Office.Core、Microsoft.Office.Interop.PowerPoint //在WPF窗口添加一个WindowsFormsHost控件 WindowsFormsHost host = new WindowsFormsHost(); this.grid.Children.Add(host); //在WindowsFormsHost控件添加一个AxHost控件,并将其类型设置为Microsoft.Office.Interop.PowerPoint.Presentation AxHost axHost = new AxHost(); axHost.Dock = DockStyle.Fill; axHost.CreateControl(); axHost.GetType().InvokeMember("Enable", BindingFlags.InvokeMethod, null, axHost, new object[] { true }); axHost.GetType().InvokeMember("DisplayAlerts", BindingFlags.SetProperty, null, axHost, new object[] { PpAlertLevel.ppAlertsNone }); host.Child = axHost; //在窗口加载事件,使用Microsoft.Office.Interop.PowerPoint.Application类加载PPT文件 private void Window_Loaded(object sender, RoutedEventArgs e) { Application pptApp = new Application(); Presentation pptPresentation = pptApp.Presentations.Open(@"D:\test.pptx", MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse); axHost.GetType().InvokeMember("Ocx", BindingFlags.SetProperty, null, axHost, new object[] { pptPresentation }); } //在AxHost控件的CreateControl方法,使用Microsoft.Office.Interop.PowerPoint.SlideShowSettings类设置PPT的播放方式 protected override void CreateControl() { base.CreateControl(); if (this.ActiveXInstance != null) { SlideShowSettings slideShowSettings = ((Presentation)this.ActiveXInstance).SlideShowSettings; slideShowSettings.ShowType = PpSlideShowType.ppShowTypeSpeaker; slideShowSettings.Run(); } } ``` 注意:在使用AxHost控件播放PPT时,需要在CreateControl方法设置PPT的播放方式。此外,由于AxHost控件是Windows Forms控件,因此需要使用WindowsFormsHost控件将其嵌入到WPF窗口

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值