{"id":137,"date":"2017-04-27T14:38:04","date_gmt":"2017-04-27T12:38:04","guid":{"rendered":"http:\/\/blog.van-daag.nl\/?p=137"},"modified":"2017-04-27T14:38:04","modified_gmt":"2017-04-27T12:38:04","slug":"outlook-save-attachements-from-multiple-emails-at-once","status":"publish","type":"post","link":"https:\/\/van-daag.nl\/?p=137","title":{"rendered":"Outlook &#8211; Save attachements from multiple emails at once"},"content":{"rendered":"<p>A department complained that they recieve a lot of emails with attachements\u00a0to save on the network drive. They needed to open all the emails one by one and save the attachement. I searched on the internet and i found <a href=\"https:\/\/gallery.technet.microsoft.com\/office\/Save-attachments-from-5b6bf54b\">mAttachementSaver<\/a><\/p>\n<p>If you can&#8217;t download this. Below is the code of\u00a0mAttachmentSaver.bas<\/p>\n<p>Used the content of the website.<\/p>\n<p>Save attachments from multiple selected items in Outlook (VBA) <script src=\"https:\/\/ajax.aspnetcdn.com\/ajax\/jquery\/jquery-1.6.1.min.js\" type=\"text\/javascript\"><\/script> <script src=\"https:\/\/i1.gallery.technet.s-msft.com\/office\/content\/common\/chili\/jquery.chili-2.2.min.js\" type=\"text\/javascript\"><\/script> <script src=\"https:\/\/i1.gallery.technet.s-msft.com\/office\/content\/common\/chili\/recipes.js\" type=\"text\/javascript\"><\/script> <script src=\"https:\/\/i1.code.msdn.s-msft.com\/RequestReduceContent\/afef98ed954e5fddffca0e93b797fa94-e21e8693778cee433c45fe498ca1bebc-RequestReducedScript.js\" type=\"text\/javascript\"><\/script> <script type=\"text\/javascript\">\n            function initializePage() {\n                var activeTabData = 'activeTab';\n                var otherTabClass = 'otherTab';\n                var hiddenPreClass = 'hidden';\n                $(\"a[href^=#]\").attr(\"target\",\"_self\");\n                $(\"div.scriptcode\").each(function (i) {\n                    var scriptBlock = $(this);\n                    scriptBlock.trackCopy(trackCodeSnippetCodeDownload);\n                    var labelElems = scriptBlock.find(\"div.title > span\");\n                    if (labelElems.length == 0) {\n                        labelElems = scriptBlock.find(\"div.title\");\n                    }\n                    var languageSpans = scriptBlock.find(\"span.hidden\");\n                    var pres = scriptBlock.find(\"pre\");\n                    if (languageSpans.length > 0 && pres.length > 1) {\n                        labelElems.each(function(index, elem) {\n                            var codePre = $(pres[index]);\n                            var labelSpan = $(elem);\n                            var languageSpan = $(languageSpans[index]);\n                            labelSpan.data('code', codePre.text().replace(\/(\\r(\\n)?)|((\\r)?\\n)\/ig, '\\r\\n'));\n                            codePre.removeClass(hiddenPreClass);  \n                            codePre.addClass(languageSpan.text().replace(\/^\\s+|\\s+$\/g,\"\"));\n                            codePre.chili();\n                            languageSpan.remove();\n                        });<\/p>\n<p>                        pres = scriptBlock.find(\"pre\");\n                        labelElems.each(function(index, elem) {\n                            var codePre = $(pres[index]);\n                            var labelSpan = $(elem);\n                            if (index == 0) {\n                                scriptBlock.data(activeTabData, 0);\n                            }\n                            else {\n                                labelSpan.addClass(otherTabClass);\n                                codePre.addClass(hiddenPreClass);  \n                            }\n                            labelSpan.click(function (e) {\n                                var activeTab = scriptBlock.data(activeTabData);\n                                $(labelElems[activeTab]).addClass(otherTabClass);   \n                                $(pres[activeTab]).addClass(hiddenPreClass);   <\/p>\n<p>                                codePre.removeClass(hiddenPreClass);    \n                                labelSpan.removeClass(otherTabClass);\n                                scriptBlock.data(activeTabData, index);<\/p>\n<p>                                if( window.parent.Galleries ) {\n                                    window.parent.Galleries.project.resizeDesc();\n                                }\n                            });\n                        });<\/p>\n<p>                        var preview = scriptBlock.find('div.preview');\n                        if (preview.length == 0) {\n                            preview = $(pres[pres.length - 1]);\n                        }\n                        preview.remove();<\/p>\n<p>                        if (window.clipboardData && clipboardData.setData) {\n                            var copyLink = $(\"<a href='#' class='copyCode'>Copy code<\/a>\");\n                            copyLink.click(function (e) {\n                                trackCodeSnippetCodeDownload();\n                                clipboardData.setData(\"Text\", $(labelElems[scriptBlock.data(activeTabData)]).data('code'));\n                                return false;\n                            });\n                            $(this).prepend(copyLink);\n                        }\n                    }\n                });<\/p>\n<p>                if ((window.parent) && (window.parent.Galleries)) {\n                    window.parent.Galleries.project.resizeDesc();\n                }<\/p>\n<p>                    if (top.location == self.location) {\n                         window.location.replace(window.location.href.replace('\/description', ''));\n                    }\n            }<\/p>\n<p>            function trackCodeSnippetCodeDownload() {\n                if ((window.parent) && (window.parent.gTracker)) {\n                    window.parent.gTracker.createActionEvent('Description', 'Download', 'Copy', 'CodeSnippet', null);\n                }\n            }<\/p>\n<p>            function overrideAnchorLinksForFirefoxAndChrome(iframeId) {\n                if(($.browser.mozilla && parseInt($.browser.version, 10) >= 2) || $.browser.webkit) {\n                    var iframeOffset = $(\"#\" + iframeId, window.parent.document).offset();\n                    $(\"a\").each(function () {\n                        var link = $(this);\n                        var href = link.attr(\"href\");\n                        if (href && href[0] == \"#\") {\n                            var name = href.substring(1);\n                            $(this).click(function () {\n                                var nameElement = $(\"[name='\" + name + \"']\");\n                                var idElement = $(\"#\" + name);\n                                var element = null;\n                                if (nameElement.length > 0) {\n                                    element = nameElement;\n                                } else if (idElement.length > 0) {\n                                    element = idElement;\n                                }<\/p>\n<p>                                if (element) {\n                                    var offset = element.offset();\n                                    window.parent.scrollTo(offset.left, offset.top + iframeOffset.top);\n                                }<\/p>\n<p>                                return false;\n                            });\n                        }\n                    });\n                }\n            }<\/p>\n<p>            $(window).load(function(){\n                initializePage();\n                overrideAnchorLinksForFirefoxAndChrome(\"longdescIframe\");<\/p>\n<p>            });<\/p>\n<p>        <\/script><\/p>\n<style type=\"text\/css\">\/* Chili -- visualBasic *\/<br \/>.visualBasic__com { color: green; }<br \/>.visualBasic__string { color: maroon; }<br \/>.visualBasic__preproc { color: gray;font-weight: bold; }<br \/>.visualBasic__number { color: red; }<br \/>.visualBasic__keyword { color: #3A3AFF; font-weight: bold; }<\/style>\n<div id=\"longDesc\">\n<h1><strong>Save attachments from multiple selected items in Outlook (VBA)<\/strong><\/h1>\n<h2><strong>Introduction<\/strong><\/h2>\n<p>This VBA sample illustrates how to save attachments from multiple selected items in Outlook.<\/p>\n<h2><strong>Scenarios<\/strong><\/h2>\n<p>When multiple items are selected, the Save Attachments option in the File menu will be grayed out, and it&#8217;s inconvenient to save attachments one by one. This script is useful and can be used to save attachments from multiple selected items all at once.<\/p>\n<h2><strong>Script<\/strong><\/h2>\n<p><em>Import the &#8220;mAttachmentSaver.bas&#8221; file.<\/em><\/p>\n<p><strong>Step1. Press Alt+F11 to open the VBE in Outlook.<\/strong><\/p>\n<p><strong>Step2. Drag the &#8220;mAttachmentSaver.bas&#8221; file to the Project Explorer (Press Ctrl+R if you cannot see it) or via File &gt;&gt; Import File&#8230; (Ctrl+M).<\/strong><\/p>\n<p><em><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" id=\"65120\" src=\"https:\/\/i0.wp.com\/gallery.technet.microsoft.com\/site\/view\/file\/65120\/1\/PE_Outlook.png?resize=241%2C130&#038;ssl=1\" alt=\"\" width=\"241\" height=\"130\" \/><\/em><\/p>\n<p><em>Run the ExecuteSaving macro to save attachments.<\/em><\/p>\n<p><strong>Step3. Go back to Outlook UI, and then press Alt+F8 to open the Macros window.<\/strong><\/p>\n<p><strong>Step4. S<\/strong><strong>elect &#8220;<em>ExecuteSaving<\/em>&#8221; in the names list, and then click the Run button (Please remember to select Outlook item(s) before running this macro).<\/strong><\/p>\n<p><strong>Step5. Select a specific folder to save attachments from Browse For Folder dialog box, and then click the OK button.<\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" id=\"65121\" src=\"https:\/\/i0.wp.com\/gallery.technet.microsoft.com\/site\/view\/file\/65121\/1\/BBF.png?resize=347%2C355&#038;ssl=1\" alt=\"\" width=\"347\" height=\"355\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Here are some code snippets for your references. To get the complete script sample, please click the Download button at the beginning of this page.<\/p>\n<div class=\"scriptcode\">\n<div class=\"pluginEditHolder\">\n<div class=\"title\">Visual Basic<\/div>\n<div class=\"pluginLinkHolder\"><span class=\"pluginEditHolderLink\">Edit<\/span>|<span class=\"pluginRemoveHolderLink\">Remove<\/span><\/div>\n<pre class=\"vb\"><span class=\"visualBasic__com\">'\u00a0######################################<\/span>\u00a0\n<span class=\"visualBasic__com\">'\u00a0Run\u00a0this\u00a0macro\u00a0for\u00a0saving\u00a0attachments.<\/span>\u00a0\n<span class=\"visualBasic__com\">'\u00a0######################################<\/span>\u00a0\n<span class=\"visualBasic__keyword\">Public<\/span>\u00a0<span class=\"visualBasic__keyword\">Sub<\/span>\u00a0ExecuteSaving()\u00a0\n\u00a0\u00a0\u00a0\u00a0<span class=\"visualBasic__keyword\">Dim<\/span>\u00a0lNum\u00a0<span class=\"visualBasic__keyword\">As<\/span>\u00a0<span class=\"visualBasic__keyword\">Long<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0lNum\u00a0=\u00a0SaveAttachmentsFromSelection\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0<span class=\"visualBasic__keyword\">If<\/span>\u00a0lNum\u00a0&gt;\u00a0<span class=\"visualBasic__number\">0<\/span>\u00a0<span class=\"visualBasic__keyword\">Then<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MsgBox\u00a0<span class=\"visualBasic__keyword\">CStr<\/span>(lNum)\u00a0&amp;\u00a0<span class=\"visualBasic__string\">\"\u00a0attachment(s)\u00a0was(were)\u00a0saved\u00a0successfully.\"<\/span>,\u00a0vbInformation,\u00a0<span class=\"visualBasic__string\">\"Message\u00a0from\u00a0Attachment\u00a0Saver\"<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0<span class=\"visualBasic__keyword\">Else<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MsgBox\u00a0<span class=\"visualBasic__string\">\"No\u00a0attachment(s)\u00a0in\u00a0the\u00a0selected\u00a0Outlook\u00a0items.\"<\/span>,\u00a0vbInformation,\u00a0<span class=\"visualBasic__string\">\"Message\u00a0from\u00a0Attachment\u00a0Saver\"<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0<span class=\"visualBasic__keyword\">End<\/span>\u00a0<span class=\"visualBasic__keyword\">If<\/span>\u00a0\n<span class=\"visualBasic__keyword\">End<\/span>\u00a0<span class=\"visualBasic__keyword\">Sub<\/span><\/pre>\n<\/div>\n<\/div>\n<div class=\"endscriptcode\"><\/div>\n<h2><em><strong>Note<\/strong><\/em><\/h2>\n<p><strong>1. Please make sure that macros are enabled in Outlook.<br \/>\n<\/strong><br \/>\n<em>For Outlook 2010:<br \/>\n<\/em><strong>File &gt;&gt; Options &gt;&gt; Trust Center &gt;&gt; Trust Center Settings &gt;&gt; Macro Settings &gt;&gt; Enable all macros &gt;&gt; OK &gt;&gt; OK &gt;&gt; Restart Outlook<\/strong><\/p>\n<p><em>For Outlook 2007:<br \/>\n<\/em><strong>Tools &gt;&gt; Macro &gt;&gt; Security&#8230; &gt;&gt; Macro &gt;&gt; Security &gt;&gt; No security check for macros &gt;&gt; OK &gt;&gt; Restart Outlook<\/strong><\/p>\n<p><em>For Outlook 2003:<br \/>\n<\/em><strong>Tools &gt;&gt; Macro &gt;&gt; Security&#8230; &gt;&gt; Macro &gt;&gt; Security &gt;&gt; Low &gt;&gt; OK &gt;&gt; Restart Outlook<\/strong><\/p>\n<p><strong>2. This macro will save all attachments even those are used in the item body.<\/strong><\/p>\n<p><strong>3. If the attachment file to be saved (let&#8217;s call &#8220;FileA.txt&#8221;) has already existed in the folder (FileA.txt, FileB.txt, FileC.txt &#8230; and so on), the date time string will be appended to the attachment file name automatically.<br \/>\n<\/strong>For example:<br \/>\nThe &#8220;FileA.txt&#8221; file may be named as &#8220;FileA_05201830669.txt&#8221;.<br \/>\n&#8220;05&#8221; means the current month;<br \/>\n&#8220;20&#8221; means the current day;<br \/>\n&#8220;18&#8221; means the current hour;<br \/>\n&#8220;30&#8221; means the current minute;<br \/>\n&#8220;669&#8221; means the current millisecond.<\/p>\n<p><strong>4. In Windows file system, the specified path cannot be so long that you cannot create or save a file. The maximum path length limitation is 260 characters. So sometimes some attachments cannot be saved successfully if the specified path is over 260 characters.<\/strong><\/p>\n<\/div>\n<pre class=\"lang:default decode:true\" title=\"mAttachmentSaver.bas\">Attribute VB_Name = \"mAttachmentSaver\"\n'---------------------------------------------------------------------------------\n' The sample scripts are not supported under any Microsoft standard support\n' program or service. The sample scripts are provided AS IS without warranty\n' of any kind. Microsoft further disclaims all implied warranties including,\n' without limitation, any implied warranties of merchantability or of fitness for\n' a particular purpose. The entire risk arising out of the use or performance of\n' the sample scripts and documentation remains with you. In no event shall\n' Microsoft, its authors, or anyone else involved in the creation, production, or\n' delivery of the scripts be liable for any damages whatsoever (including,\n' without limitation, damages for loss of business profits, business interruption,\n' loss of business information, or other pecuniary loss) arising out of the use\n' of or inability to use the sample scripts or documentation, even if Microsoft\n' has been advised of the possibility of such damages.\n'---------------------------------------------------------------------------------\n\nOption Explicit\n\n' *****************\n' For Outlook 2010.\n' *****************\n#If VBA7 Then\n    ' The window handle of Outlook.\n    Private lHwnd As LongPtr\n    \n    ' \/* API declarations. *\/\n    Private Declare PtrSafe Function FindWindow Lib \"user32\" Alias \"FindWindowA\" (ByVal lpClassName As String, _\n        ByVal lpWindowName As String) As LongPtr\n    \n' *****************************************\n' For the previous version of Outlook 2010.\n' *****************************************\n#Else\n    ' The window handle of Outlook.\n    Private lHwnd As Long\n    \n    ' \/* API declarations. *\/\n    Private Declare Function FindWindow Lib \"user32\" Alias \"FindWindowA\" (ByVal lpClassName As String, _\n        ByVal lpWindowName As String) As Long\n#End If\n\n' The class name of Outlook window.\nPrivate Const olAppCLSN As String = \"rctrl_renwnd32\"\n' Windows desktop - the virtual folder that is the root of the namespace.\nPrivate Const CSIDL_DESKTOP = &amp;H0\n' Only return file system directories. If the user selects folders that are not part of the file system, the OK button is grayed.\nPrivate Const BIF_RETURNONLYFSDIRS = &amp;H1\n' Do not include network folders below the domain level in the dialog box's tree view control.\nPrivate Const BIF_DONTGOBELOWDOMAIN = &amp;H2\n' The maximum length for a path is 260 characters.\nPrivate Const MAX_PATH = 260\n\n' ######################################################\n'  Returns the number of attachements in the selection.\n' ######################################################\nPublic Function SaveAttachmentsFromSelection() As Long\n    Dim objFSO              As Object       ' Computer's file system object.\n    Dim objShell            As Object       ' Windows Shell application object.\n    Dim objFolder           As Object       ' The selected folder object from Browse for Folder dialog box.\n    Dim objItem             As Object       ' A specific member of a Collection object either by position or by key.\n    Dim selItems            As Selection    ' A collection of Outlook item objects in a folder.\n    Dim atmt                As Attachment   ' A document or link to a document contained in an Outlook item.\n    Dim strAtmtPath         As String       ' The full saving path of the attachment.\n    Dim strAtmtFullName     As String       ' The full name of an attachment.\n    Dim strAtmtName(1)      As String       ' strAtmtName(0): to save the name; strAtmtName(1): to save the file extension. They are separated by dot of an attachment file name.\n    Dim strAtmtNameTemp     As String       ' To save a temporary attachment file name.\n    Dim intDotPosition      As Integer      ' The dot position in an attachment name.\n    Dim atmts               As Attachments  ' A set of Attachment objects that represent the attachments in an Outlook item.\n    Dim lCountEachItem      As Long         ' The number of attachments in each Outlook item.\n    Dim lCountAllItems      As Long         ' The number of attachments in all Outlook items.\n    Dim strFolderPath       As String       ' The selected folder path.\n    Dim blnIsEnd            As Boolean      ' End all code execution.\n    Dim blnIsSave           As Boolean      ' Consider if it is need to save.\n    \n    blnIsEnd = False\n    blnIsSave = False\n    lCountAllItems = 0\n    \n    On Error Resume Next\n    \n    Set selItems = ActiveExplorer.Selection\n    \n    If Err.Number = 0 Then\n        \n        ' Get the handle of Outlook window.\n        lHwnd = FindWindow(olAppCLSN, vbNullString)\n        \n        If lHwnd &lt;&gt; 0 Then\n            \n            ' \/* Create a Shell application object to pop-up BrowseForFolder dialog box. *\/\n            Set objShell = CreateObject(\"Shell.Application\")\n            Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n            Set objFolder = objShell.BrowseForFolder(lHwnd, \"Select folder to save attachments:\", _\n                                                     BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN, CSIDL_DESKTOP)\n            \n            ' \/* Failed to create the Shell application. *\/\n            If Err.Number &lt;&gt; 0 Then\n                MsgBox \"Run-time error '\" &amp; CStr(Err.Number) &amp; \" (0x\" &amp; CStr(Hex(Err.Number)) &amp; \")':\" &amp; vbNewLine &amp; _\n                       Err.Description &amp; \".\", vbCritical, \"Error from Attachment Saver\"\n                blnIsEnd = True\n                GoTo PROC_EXIT\n            End If\n            \n            If objFolder Is Nothing Then\n                strFolderPath = \"\"\n                blnIsEnd = True\n                GoTo PROC_EXIT\n            Else\n                strFolderPath = CGPath(objFolder.Self.Path)\n                \n                ' \/* Go through each item in the selection. *\/\n                For Each objItem In selItems\n                    lCountEachItem = objItem.Attachments.Count\n                    \n                    ' \/* If the current item contains attachments. *\/\n                    If lCountEachItem &gt; 0 Then\n                        Set atmts = objItem.Attachments\n                        \n                        ' \/* Go through each attachment in the current item. *\/\n                        For Each atmt In atmts\n                            \n                            ' Get the full name of the current attachment.\n                            strAtmtFullName = atmt.FileName\n                            \n                            ' Find the dot postion in atmtFullName.\n                            intDotPosition = InStrRev(strAtmtFullName, \".\")\n                            \n                            ' Get the name.\n                            strAtmtName(0) = Left$(strAtmtFullName, intDotPosition - 1)\n                            ' Get the file extension.\n                            strAtmtName(1) = Right$(strAtmtFullName, Len(strAtmtFullName) - intDotPosition)\n                            ' Get the full saving path of the current attachment.\n                            strAtmtPath = strFolderPath &amp; atmt.FileName\n                            \n                            ' \/* If the length of the saving path is not larger than 260 characters.*\/\n                            If Len(strAtmtPath) &lt;= MAX_PATH Then\n                                ' True: This attachment can be saved.\n                                blnIsSave = True\n                                \n                                ' \/* Loop until getting the file name which does not exist in the folder. *\/\n                                Do While objFSO.FileExists(strAtmtPath)\n                                    strAtmtNameTemp = strAtmtName(0) &amp; _\n                                                      Format(Now, \"_mmddhhmmss\") &amp; _\n                                                      Format(Timer * 1000 Mod 1000, \"000\")\n                                    strAtmtPath = strFolderPath &amp; strAtmtNameTemp &amp; \".\" &amp; strAtmtName(1)\n                                        \n                                    ' \/* If the length of the saving path is over 260 characters.*\/\n                                    If Len(strAtmtPath) &gt; MAX_PATH Then\n                                        lCountEachItem = lCountEachItem - 1\n                                        ' False: This attachment cannot be saved.\n                                        blnIsSave = False\n                                        Exit Do\n                                    End If\n                                Loop\n                                \n                                ' \/* Save the current attachment if it is a valid file name. *\/\n                                If blnIsSave Then atmt.SaveAsFile strAtmtPath\n                            Else\n                                lCountEachItem = lCountEachItem - 1\n                            End If\n                        Next\n                    End If\n                    \n                    ' Count the number of attachments in all Outlook items.\n                    lCountAllItems = lCountAllItems + lCountEachItem\n                Next\n            End If\n        Else\n            MsgBox \"Failed to get the handle of Outlook window!\", vbCritical, \"Error from Attachment Saver\"\n            blnIsEnd = True\n            GoTo PROC_EXIT\n        End If\n        \n    ' \/* For run-time error:\n    '    The Explorer has been closed and cannot be used for further operations.\n    '    Review your code and restart Outlook. *\/\n    Else\n        MsgBox \"Please select an Outlook item at least.\", vbExclamation, \"Message from Attachment Saver\"\n        blnIsEnd = True\n    End If\n    \nPROC_EXIT:\n    SaveAttachmentsFromSelection = lCountAllItems\n    \n    ' \/* Release memory. *\/\n    If Not (objFSO Is Nothing) Then Set objFSO = Nothing\n    If Not (objItem Is Nothing) Then Set objItem = Nothing\n    If Not (selItems Is Nothing) Then Set selItems = Nothing\n    If Not (atmt Is Nothing) Then Set atmt = Nothing\n    If Not (atmts Is Nothing) Then Set atmts = Nothing\n    \n    ' \/* End all code execution if the value of blnIsEnd is True. *\/\n    If blnIsEnd Then End\nEnd Function\n\n' #####################\n' Convert general path.\n' #####################\nPublic Function CGPath(ByVal Path As String) As String\n    If Right(Path, 1) &lt;&gt; \"\\\" Then Path = Path &amp; \"\\\"\n    CGPath = Path\nEnd Function\n\n' ######################################\n' Run this macro for saving attachments.\n' ######################################\nPublic Sub ExecuteSaving()\n    Dim lNum As Long\n    \n    lNum = SaveAttachmentsFromSelection\n    \n    If lNum &gt; 0 Then\n        MsgBox CStr(lNum) &amp; \" attachment(s) was(were) saved successfully.\", vbInformation, \"Message from Attachment Saver\"\n    Else\n        MsgBox \"No attachment(s) in the selected Outlook items.\", vbInformation, \"Message from Attachment Saver\"\n    End If\nEnd Sub\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A department complained that they recieve a lot of emails with attachements\u00a0to save on the network drive. They needed to open all the emails one by one and save the attachement. I searched on the internet and i found mAttachementSaver If you can&#8217;t download this. Below is the code of\u00a0mAttachmentSaver.bas Used the content of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,19,20],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-outlook-2010","category-windows-10","category-windows-7"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":0,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"wp:attachment":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}