C++builder 显示ppt

终极威天 2014-09-13 10:22:44
#include "ComObj.hpp"
Variant vPowerPoint;
try {
vPowerPoint = CreateOleObject("PowerPoint.Application");
}
catch (...) {
ShowMessage("Error...");
}
vPowerPoint.OlePropertySet("Visible", true);

String strPptFile = "D:\\workspeis\\123.ppt";
vPowerPoint.OlePropertyGet("Presentations").OleFunction("Open",
strPptFile.c_str(), false, false, true);
vPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet
("SlideShowSettings").OleFunction("Run");
妖哥我用你这段代码显示 PowerPoint Could not open the file
怎么改 ,,还有妖哥这ole还能隐藏powerpoint页面,用自己的窗口显示ppt谢谢
...全文
129 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
终极威天 2014-09-13
  • 打赏
  • 举报
回复
哦 谢谢妖哥
引用 2 楼 ccrun 的回复:
首先,OLE打开文件,我现在建议这样写:
String strPptFile = "D:\\workspeis\\123.ppt";
vPowerPoint.OlePropertyGet("Presentations").OleFunction("Open",
        WideString(strPptFile), false, false, true);
其次,你说的在自己窗体上显示PPT,可以考虑用OLEContainer,不过也很麻烦的,还要隐藏工具栏菜单栏什么的,不同版本的PowerPoint还有差异。
ccrun.com 2014-09-13
  • 打赏
  • 举报
回复
首先,OLE打开文件,我现在建议这样写:
String strPptFile = "D:\\workspeis\\123.ppt";
vPowerPoint.OlePropertyGet("Presentations").OleFunction("Open",
        WideString(strPptFile), false, false, true);
其次,你说的在自己窗体上显示PPT,可以考虑用OLEContainer,不过也很麻烦的,还要隐藏工具栏菜单栏什么的,不同版本的PowerPoint还有差异。
终极威天 2014-09-13
  • 打赏
  • 举报
回复
求各位大神解决,,跪求妖哥来此贴 ,,,解决问题谢谢

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧