PowerPoint addin

 

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.

你可能感兴趣的:(PowerPoint addin)