Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active April 26, 2021 15:32
Show Gist options
  • Save JoeGlines/a2b8dcc88fb34c59d165061ea9440a0e to your computer and use it in GitHub Desktop.
Save JoeGlines/a2b8dcc88fb34c59d165061ea9440a0e to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
Selection := ComObjActive("Outlook.Application").ActiveExplorer().Selection ;Connect to Outlook and store list of selected emails
For a,b in Selection { ;Loop over selected emails
oAtt:=selection.item(A_Index).Attachments ;For each email, create object storing the attachments
for k, v in oAtt ;use For loop over attachments
k.SaveAsFile("C:\temp\" . k.DisplayName) ;This will write the files to the C:\temp\ folder. Update for your needs.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment