使用dsoframer演示ppt

 


优点:

(1)不用直接打开PowerPoint

(2)可以嵌入到Form中,那种先打开ppt然后将ppt嵌入到Form中的方式,会先打开PowerPoint

缺点:

很早就停止更新了。。。。  但是没办法还是这个好用

1.以管理员的身份运行程序

需要以管理员的身份运行程序(winform)

2.下载并注册dsoframer.ocx

dsoframer控件注册,解注册和检查注册情况

3.添加dsoframer控件

常规处,右键 点击“选择项”  点击“COM组件” 选中“DSO Framer Control Object” 确定 

 

4.使用方式

(1)打开方式:

axFramerControl1.Open(s, true, "PowerPoint.Show", "", "");

(2)Form全屏:

axFramerControl1.Focus();
SendKeys.SendWait("F5");

(3)上一张ppt

axFramerControl1.Focus();
SendKeys.SendWait("P");

(4)下一张ppt

axFramerControl1.Focus();
SendKeys.SendWait("N");

(5)电脑屏幕全屏(这样做,和PowerPoint软件F5播放效果一样)

axFramerControl1.Focus();
SendKeys.SendWait("F5");

 

需要引入:

 

axFramerControl1.Open(s, true, "PowerPoint.Show", "", "");

//全屏

objPresSet = axFramerControl1.ActiveDocument as Presentation;
objPresSet.SlideShowSettings.Run();

//关闭

if (objPresSet != null)
{
objPresSet.Close();
objPresSet = null;
}

(7)关闭

axFramerControl1.Close();

5.程序安装时注册dsoframer

程序安装时注册dsoframer.ocx控件

问题:

(1)当文件放在服务器上,且地址含有中文时,会报错:System.IO.FileNotFoundException:“指定资源下载失败。

像这种http://www.exaple.com/file/你好.pptx

解决:

Uri.EscapeUriString(filePath);

 (2)unable to display inactive document,click here to reactive the object

SendKeys.SendWait("F5");  之后 隐藏在显示 会出现ppt画面变为白板 显示文字“unable to display inactive document,click here to reactive the object”

解决:

ActivationPolicy = dsoKeepUIActiveOnAppDeactive

 

posted @   翻白眼的哈士奇  阅读(943)  评论(2编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示