Outlook How To Save Attachment using the Custom Context Menu button

Add-in Express™ Support Service
That's what is more important than anything else

Outlook How To Save Attachment using the Custom Context Menu button
Outlook How To Save Attachment using the Custom Context Menu button 
Balaji Kumar




Posts: 2
Joined: 2018-05-17
Hi,

I would like to build a functionality of Saving Attachment to Disk/Drive using the Custom Context Menu button.

I am able to add a Context Menu but when i click on the button How can i get the selected Attachment Object to save as file.

Kindly share if you have any code sample that would be great help.


Regards,
Bala
Posted 17 May, 2018 08:10:15 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Balaji,

In my email I wrote:

Install the add-in described at https://www.add-in-express.com/creating-addins-blog/2015/04/15/creating-office-context-menu-addin/, open that context menu and click the button the add-in shows at the bottom of it. Then Open Notepad and paste from clipboard.


Please copy here what you pasted to Notepad.


Andrei Smolin
Add-in Express Team Leader
Posted 17 May, 2018 08:42:26 Top
Balaji Kumar




Posts: 2
Joined: 2018-05-17
Please find the below as instructed. Kindly let me know how to handle what i am looking for.

Context menu name = "ContextMenuAttachments"
Context object type name="AttachmentSelection"

Thank you

Balaji
Posted 17 May, 2018 09:09:49 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
The code that you sent me doesn't check for the AttachmentSelection type. Add an ElseIf checking for AttachmentSelection. Within the Elsif code, create a variable of the AttachmentSelection type, cast the context object to AttachmentSelection and set the result to the variable (you may want to check if it is Nothing), use the variable to find the attachment(s) selected.


Andrei Smolin
Add-in Express Team Leader
Posted 17 May, 2018 09:59:11 Top