代码如下:
if (!m_App.CreateDispatch("Powerpoint.Application"))
{
AfxMessageBox("Couldn't start PowerPoint.");
}
else
{
m_App.SetVisible(TRUE); //此处不能写为 m_App.SetVisible(FALSE);
TRACE("PowerPoint is Running!");
} CString strFileName = "C:\\1111.pptx";
if (!strFileName.IsEmpty())
{
m_Presentations = m_App.GetPresentations();
m_Presentation = m_Presentations.Open(strFileName,0,0,1);
}
....... m_Presentation=m_App.GetActivePresentation();
m_Presentation.Close(); m_App.Quit();
m_App.DetachDispatch(); 请问:1.如何在程序启动时直接播放PPT,而不是先显示一个PPT页面大纲之后再播放,本来是准备在显示PPT页面大纲时用 m_App.SetVisible(FALSE);但是会报错;
2.程序退出时 m_Presentation=m_App.GetActivePresentation();
m_Presentation.Close();
m_App.Quit();
m_App.DetachDispatch();
也只是关闭正在播放的PPT,而不会关闭PPT页面,请问该如何关闭PPT页面,谢谢!
if (!m_App.CreateDispatch("Powerpoint.Application"))
{
AfxMessageBox("Couldn't start PowerPoint.");
}
else
{
m_App.SetVisible(TRUE); //此处不能写为 m_App.SetVisible(FALSE);
TRACE("PowerPoint is Running!");
} CString strFileName = "C:\\1111.pptx";
if (!strFileName.IsEmpty())
{
m_Presentations = m_App.GetPresentations();
m_Presentation = m_Presentations.Open(strFileName,0,0,1);
}
....... m_Presentation=m_App.GetActivePresentation();
m_Presentation.Close(); m_App.Quit();
m_App.DetachDispatch(); 请问:1.如何在程序启动时直接播放PPT,而不是先显示一个PPT页面大纲之后再播放,本来是准备在显示PPT页面大纲时用 m_App.SetVisible(FALSE);但是会报错;
2.程序退出时 m_Presentation=m_App.GetActivePresentation();
m_Presentation.Close();
m_App.Quit();
m_App.DetachDispatch();
也只是关闭正在播放的PPT,而不会关闭PPT页面,请问该如何关闭PPT页面,谢谢!
可以找到ppt窗口,然后隐藏
ppt可以打包成独立的播放文件吧
然后直接执行那个文件不就好了