I have made an Outlook plugin for 64 bit version of Outlook 2013 using Visual Studio Community 2013. I want to work with attachments from mail when sending mails.
The plugin is not loaded by Outlook even though LoadBehavior=3
in the registry and if I try to load it in Outlook, I get nothing.
So there is the beginning of the header of my class CConnect
:
class ATL_NO_VTABLE CConnect :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CConnect, &CLSID_Connect>,
public IDispatchImpl<IConnect, &IID_IConnect, &LIBID_PluginOutlookLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
public IDispatchImpl<_IDTExtensibility2, &__uuidof(_IDTExtensibility2), &LIBID_AddInDesignerObjects, /* wMajor = */ 1>,
public IDispEventSimpleImpl < 1, CConnect, &__uuidof(Outlook::ItemEvents) >
{
public:
CConnect()
{
};
void __stdcall OnSend(IDispatch * Item, bool Cancel);
BEGIN_SINK_MAP(CConnect)
SINK_ENTRY_INFO(1,__uuidof(Outlook::ItemEvents),0x0000F005,OnSend,&fiMailItemEvents)
END_SINK_MAP()
DECLARE_REGISTRY_RESOURCEID(IDR_CONNECT)
BEGIN_COM_MAP(CConnect)
COM_INTERFACE_ENTRY(IConnect)
COM_INTERFACE_ENTRY(_IDTExtensibility2)
END_COM_MAP()
There is an entry in the registry for the plugin.
Does someone have a good idea how to to load the plugin successfully in Outlook?
If an attachment have a size bigger than msize I want to save it with SaveAsFile()
and to proccess it.
What are the arguments of Attachment::SaveAsFile()
I didn't find them in the documentation and is there any method Attachment::size()
?
Are you trying to handle the Send or ItemSend event?
See the SaveAsFile method description in MSDN.
Also you may find the Size property of the Attachment class helpful.