title: How to create a MAPI32.dll stub to be able to "send as attachment" from MS Word?
body: <p>Microsoft Word has "send as attachment" functionality which creates a new message in Outlook with the document attached. </p>
  
  <p>I would like to replace Outlook with a custom mail agent, but I do not know how to achieve this. Now my mail agent is simply a program that runs, and takes a file name as parameter. </p>
  
  <p>As far as I know, "send as attachment" is using some DLL/API called MAPI. I would need to change my app so that it does not simply accept file name arguments, but can receive MAPI(?) calls MS Word uses when "sending as attachment".</p>
  
  <p>Further, I need to change the default mail agent by creating my own MAPI32.dll stub which simply redirects to my app.</p>
  
  <p>I'd appreciate if anyone had more info on how this could be achieved!</p>