我隐藏了Powerpoint自动化功能 [英] I hide powerpoint automation features

查看:183
本文介绍了我隐藏了Powerpoint自动化功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CApplication app(FALSE);
	

if( !app.CreateDispatch(_T("Powerpoint.Application"))){
    AfxMessageBox(L"Coudn't Start ppt");
    return;
}
else
{
    app.put_Visible(FALSE);





Application.Visible:无效请求.不允许隐藏应用程序窗口..

我怎么能隐藏???





Application.Visible : Inalid request. Hiding the application window is not allowed..

How can i hide???

推荐答案

因为我不知道你的意图,所以不能确定这就是你想要的.

但是,默认情况下,开始使用自动化功能时它不可见.
以下内容适用于excel VBA.没有显示PPT窗口,没有创建文件,没有将应用程序保留在任务管理器中.



Can''t be sure it''s what you want, since I don''t know your intention.

However, by default it''s not visible when started using automation features.
The following works for me from excel VBA. No PPT window is shown, the file is created, the application doesn''t remain in the task manager.



Sub CreatePptFileInBkg()
    Dim ppt As Object
    Dim curPres As Object
    Set ppt = CreateObject("PowerPoint.Application")
    Set curPres = ppt.Presentations.Add
    curPres.SaveAs FileName:="c:\PPTSample1.pptx"
    ppt.Quit
End Sub


这篇关于我隐藏了Powerpoint自动化功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆