zoukankan      html  css  js  c++  java
  • 使用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

  • 相关阅读:
    表单提交:button input submit 的区别
    JavaScript中改变this指针的注意事项
    宝塔服务器配置nginx刷新404的问题汇总
    ES6笔记整理
    axios网络请求
    v-model双向绑定
    v-bind动态绑定
    前端模块化
    vue router 路由
    JS高阶函数
  • 原文地址:https://www.cnblogs.com/yaosj/p/10877567.html
Copyright © 2011-2022 走看看