// 获得当前PPT活动文档名字及路径
CComQIPtr <MSPPT::_Application> spApp(g_Application);
CComPtr <MSPPT::_Presentation> spPre;
spApp->get_ActivePresentation(&spPre);
if ( spPre != NULL )
{
CComBSTR bstrName;
spPre->get_FullName(&bstrName);
g_strPath = bstrName.m_str;
MessageBox(NULL, g_strPath, _T("当前文档名字及路径"), MB_OK);
}
该段代码不要放在OnConnection中。
更多技术文章请参看施昌权的个人网站: http://www.joyvc.cn