PowerPoint addin

202 篇文章 4 订阅 ¥19.90 ¥99.00
本文介绍了如何使用示例项目的大部分代码来构建PowerPoint加载项。主要区别在于:1) 使用`#import`指令引用PowerPoint相关库;2) 通过Application对象获取CommandBars集合;3) 在注册表中为PowerPoint加载项设置不同的键值。
摘要由CSDN通过智能技术生成
 

What changes I have to do in this example.Or do I have to write another code.
 

 
Hello,
Basically you can use most of the sample project code to build your powerpoint addin. There are a few things that are different from the outlook addin project.
 
These are -
1)#import - the import statements in stdafx.h for my powerpoint addin looks like -
 
#import "C:\Program Files\Common Files\Microsoft Shared\Office10\mso.dll" rename_namespace("Office"), named_guids
using namespace Office;
 
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.olb"
#import "C:\Program Files\Microsoft Office\Office\MSPPT9.olb" rename_namespace("PowerPoint")
using namespace PowerPoint;
 

2)You can obtain a pointer to the CommandBars collection thru the Application object's get_CommandBars() method .Thus in OnConnection() the code to do this looks like:
 
CComQIPtr spApp(Application);
ATLASSERT(spApp);
HRESULT hr = spApp->get_CommandBars(&spCmdBars);
if(FAILED(hr))
return hr;
ATLASSERT(spCmdBars);
 

3) reg keys to register your addin is also different.
Additions to my powerpoint project's registry script(*.rgs) looks like:
 
HKCU(or HKLM)
{
Software
{
Microsoft
{
Office
{
9.0
{
Powerpoint
{
Addins
{
'PPAddin.Addin'
{
val FriendlyName = s 'PP Addin'
val Description = s 'ATLCOM Powerpoint Addin'
val LoadBehavior = d '00000003'
val CommandLineSafe = d '00000000'
}
}
}
}

}
}
}
}
 
That's all.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值