Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Austin, TX USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook 2016: Change location where received attachments are stored

    I am running Outlook 2016 (Office 365) under Windows 10. I would like Outlook to save all received attachments automatically to a single simple folder (where I can subsequently sort them out - moving some to their correct final locations, and deleting most others). [And yes, I realize this will break the link between the email message and the attachment. At present, it appears that Outlook "hides" the attachments in a mass collection of "user/appdata ..." folders that are basically impossible to get to. For my needs, this is completely unacceptable. It also means that I *must* go through and manually move (save as) each individual attachment from the email view - which is frequently not practical.

    It should not be this hard to change. Either an Outlook option, or a registry edit should be the most that is required to change this - but for the life of me, I cannot find it. All I see is how to make Outlook change the "save as" default destination, and even that apparently no longer works. {:<(

    Any suggestions?

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    http://answers.microsoft.com/en-us/o...316a595?auth=1

    This should work, changing the version number to 16.0
    Rui
    -------
    R4

  3. #3
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,572
    Thanks
    5
    Thanked 1,057 Times in 926 Posts
    See Outlook SecureTemp Files Folder. Outlook 2016 is version 16.0.

    Joe

  4. #4
    New Lounger
    Join Date
    Dec 2009
    Location
    Austin, TX USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [QUOTE=JoeP517;1048411]See Outlook SecureTemp Files Folder. Outlook 2016 is version 16.0.


    Thanks, but both suggestions don't seem to work, and aren't addressing my problem. [But I seriously DO appreciate the suggestions.]

    Outlook 2016 seems to override the registry. I can set the change (as described above). However, the attachment is still put in the same place (upon receipt), and when opened, Outlook changes the registry edit back to some variation of right where it was before. [Saving the registry while Outlook is closed, and then opening Outlook, makes no difference. This is consistent with what I have seen elsewhere on the web - namely, that the old registry edit that worked through Outlook 2013, etc. no longer works.]

    But I must have explained my problem poorly anyway, because these all address either a) the default "save as" option on the attachment, or b) the securetemp folder that holds the file (copy) only while the attachment is open. What I am trying to change is where the attachment is automatically stored when it is RECEIVED! In other words, if I receive a bunch of emails (okay, mostly spam), and five have attachments, then I want to open a folder (such as D:\Mail Attachments) - even without reading the emails - and see five files (the attachments) in there. I don't want them scattered among thousands of hidden folders under APPDATA.

    Again, much appreciate the suggestions. Hopefully I have explained the problem better. tnx, jmk

  5. #5
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Seems Joe's suggestion should be what you need. I don't know of any other way, tbh. Sorry.
    Rui
    -------
    R4

  6. #6
    New Lounger
    Join Date
    Dec 2009
    Location
    Austin, TX USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ruirib View Post
    Seems Joe's suggestion should be what you need. I don't know of any other way, tbh. Sorry.
    Unfortunately, no. [Although I did find the page interesting.] As you can see, it references the "secure temporary file folder." For reasons the article explains, when you OPEN the attachment to an email, Outlook actually copies the attachment into a temporary (and ordinary) folder. This, the article, explains, allows anti-virus programs to have a shot at the attachment. The attachment *copy* is then deleted automatically when the attachment is closed. [With a couple of bugs, as explained in the article.]

    Sadly, this has nothing to do with my problem. Right now every received attachment (that is, when the email is first received) gets placed in a unique and special file and folder created when the email is received from the sender. You receive a 100 emails, each of which has attachments? Outlook creates 100 new folders!!!

    Worse (from my standpoint), each of these folders is not only hidden but basically unreachable by normal Windows Explorer actions. [There *are* ways, but nothing realistic for 100s or thousands of emails.]

    I just want it to stick my *incoming* email attachments in a single folder that can be opened like any other.

    Again, though - I really do thank every one for their suggestions and effort. I guess Outlook just doesn't have anywhere near the capabilities of something like Eudora.

  7. #7
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    I suppose the only way with outlook would to be to run a script to do that. The script would have to be coded, of course, but it would definitely be possible.
    Rui
    -------
    R4

  8. #8
    Super Moderator
    Join Date
    Jun 2011
    Location
    New England
    Posts
    4,746
    Thanks
    171
    Thanked 649 Times in 572 Posts
    There are various utilities that can do what you want; some free, but the best ones are paid:

    Many of these utilities will remove attachments from the email message and can replace them with links to the attachment on your hard drive,
    allowing you easy access to the attachment while keeping your mailbox or personal folders smaller.


    Attachment Management Tools for Outlook (at slipstick.com)

  9. #9
    Star Lounger Graham Mayor's Avatar
    Join Date
    Mar 2016
    Location
    Cyprus
    Posts
    68
    Thanks
    0
    Thanked 24 Times in 24 Posts
    The following Outlook macros can be used to process a single message, a folder of messages, or by using the main macro as a script with a rule, automatically as the messages arrive. The messages are saved to a named folder, which is created if it doesn't exist. No existing filename is overwritten.
    Code:
    Option Explicit
    
    Sub ProcessAttachment()
    'An Outlook macro by Graham Mayor
    Dim olMsg As MailItem
        On Error Resume Next
        Set olMsg = ActiveExplorer.Selection.Item(1)
        SaveAttachments olMsg
    lbl_Exit:
        Exit Sub
    End Sub
    
    Sub ProcessFolder()
    'An Outlook macro by Graham Mayor
    Dim olNS As Outlook.NameSpace
    Dim olMailFolder As Outlook.MAPIFolder
    Dim olItems As Outlook.Items
    Dim olMailItem As Outlook.MailItem
    Dim ofrm As New frmProgress
    Dim PortionDone As Double
    Dim i As Long
    
        On Error GoTo err_Handler
        Set olNS = GetNamespace("MAPI")
        Set olMailFolder = olNS.PickFolder
        Set olItems = olMailFolder.Items
        ofrm.Show vbModeless
        i = 0
        For Each olMailItem In olItems
            i = i + 1
            PortionDone = i / olItems.Count
            ofrm.lblProgress.Width = ofrm.fmeProgress.Width * PortionDone
            SaveAttachments olMailItem
            DoEvents
        Next olMailItem
    err_Handler:
        Unload ofrm
        Set ofrm = Nothing
        Set olNS = Nothing
        Set olMailFolder = Nothing
        Set olItems = Nothing
        Set olMailItem = Nothing
    lbl_Exit:
        Exit Sub
    End Sub
    
    
    Private Sub SaveAttachments(olItem As MailItem)
    'An Outlook macro by Graham Mayor
    Dim olAttach As Attachment
    Dim strFname As String
    Dim strExt As String
    Dim j As Long
    Const strSaveFldr As String = "D:\Path\Reports\"
    
        CreateFolders strSaveFldr
        On Error GoTo CleanUp
        If olItem.Attachments.Count > 0 Then
            For j = olItem.Attachments.Count To 1 Step -1
                Set olAttach = olItem.Attachments(j)
                If Not olAttach.FileName Like "image*.*" Then
                    strFname = olAttach.FileName
                    strExt = Right(strFname, Len(strFname) - InStrRev(strFname, Chr(46)))
                    strFname = FileNameUnique(strSaveFldr, strFname, strExt)
                    olAttach.SaveAsFile strSaveFldr & strFname
                    'olAttach.Delete        'delete the attachment
                End If
            Next j
            olItem.Save
        End If
    CleanUp:
        Set olAttach = Nothing
        Set olItem = Nothing
    lbl_Exit:
        Exit Sub
    End Sub
    
    Private Function FileNameUnique(strPath As String, _
                                    strFileName As String, _
                                    strExtension As String) As String
    'An Outlook macro by Graham Mayor
    Dim lngF As Long
    Dim lngName As Long
        lngF = 1
        lngName = Len(strFileName) - (Len(strExtension) + 1)
        strFileName = Left(strFileName, lngName)
        Do While FileExists(strPath & strFileName & Chr(46) & strExtension) = True
            strFileName = Left(strFileName, lngName) & "(" & lngF & ")"
            lngF = lngF + 1
        Loop
        FileNameUnique = strFileName & Chr(46) & strExtension
    lbl_Exit:
        Exit Function
    End Function
    
    Private Function FileExists(filespec) As Boolean
    'An Outlook macro by Graham Mayor
    Dim fso As Object
        Set fso = CreateObject("Scripting.FileSystemObject")
        If fso.FileExists(filespec) Then
            FileExists = True
        Else
            FileExists = False
        End If
    lbl_Exit:
        Exit Function
    End Function
    
    Private Function FolderExists(fldr) As Boolean
    'An Outlook macro by Graham Mayor
    Dim fso As Object
        Set fso = CreateObject("Scripting.FileSystemObject")
        If (fso.FolderExists(fldr)) Then
            FolderExists = True
        Else
            FolderExists = False
        End If
    lbl_Exit:
        Exit Function
    End Function
    
    Private Function CreateFolders(strPath As String)
    'An Outlook macro by Graham Mayor
    Dim strTempPath As String
    Dim lngPath As Long
    Dim vPath As Variant
        vPath = Split(strPath, "\")
        strPath = vPath(0) & "\"
        For lngPath = 1 To UBound(vPath)
            strPath = strPath & vPath(lngPath) & "\"
            If Not FolderExists(strPath) Then MkDir strPath
        Next lngPath
    lbl_Exit:
        Exit Function
    End Function

  10. #10
    New Lounger
    Join Date
    Dec 2009
    Location
    Austin, TX USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Graham.

    I got the basic code to work as a VBA script, then tried to move it to a rule. Didn't have any trouble with that (in essence), including making the rule run every time a new message arrives. However, since the script expects an item to be selected, and arrived messages aren't (apparently) automatically selected when the rule runs, it's skipping everything.

    I can't seem to find a list of designator terms for telling it to use "the current mailitem being processed." Any ideas? tnx, jmk

  11. #11
    Star Lounger Graham Mayor's Avatar
    Join Date
    Mar 2016
    Location
    Cyprus
    Posts
    68
    Thanks
    0
    Thanked 24 Times in 24 Posts
    I have marked the main sub as Private. Remove 'Private' from Private Sub SaveAttachments(olItem As MailItem). You should then be able to use that sub as a script attached to a rule. The rule should be something like:
    Rule.png
    The rule will thus act on any message that fits the criteria i.e. with an attachment, that arrives in the Inbox. It doesn't require an item to be 'selected'.

  12. #12
    New Lounger
    Join Date
    Dec 2009
    Location
    Austin, TX USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks... found the problem. When I extracted the "saveattachments" code, I somehow botched up the olItem reference. Need a few more tests, then sign it and move the security level back up. Then it should work like I want. Much appreciation to you, and to everyone else who took the time to answer.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •