fetching blocked attachments

raylward102

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
I have adjusted windows registry to block certain attachments (xls, doc, xlsm, docm), so users won't accidentally, on auto pilot, execute an attachment, potentially harboring a malware. For those who are unaware, files carrying those extensions, can contain macro vba code. In my opinion, there's no reason to be using those formats via email.
With the registry block in place, the user sees the email has an attachment, but the contents of the message, prohibits user from accessing the attachment; instead a message is presented stating the attachment has been blocked.
This approach to blocking is effective, but, would like to be able to download these attachments to a folder. I had hoped to create a vba add-in, allowing user to see the blocking occur, but still allow them to download safely with my add-in; my add-in would save these attachments to a folder on the desktop, and open them via 'sandboxie' application; the 'sandboxie' application, basically allows you to open suspect, quarantined items, in a closed environment, that is scrapped as soon as you close the window; preventing any changes to the computer. I want to do this because, the users still have a need for viewing the content of these potentially harmful attachments, as some of them will be legitimate.
I realize, the windows registry is configured to block these attachments via the outlook user interface, but know the attachments are still physically present, in the outlook mail store (unblocking via windows registry returns access to these attachments).

The following code, downloads the attachments from the email message in focus; can anybody think of away to alter my code, so it can see blocked attachments. Currently, with blocking enabled, it does not see the attachments.

Code:
Public Sub saveAttachtoDisk()
    Dim objAtt As Outlook.Attachment
    Dim olMsg As Outlook.MailItem
    Dim strDate As String
    Dim strName As String
    Dim saveFolder As String
    Dim saveSubFolder As String
    Dim x As Long
    
    saveFolder = Environ("userprofile") & "\desktop\BlockedAttachments\"
    Err.Clear
    On Error Resume Next
    'detect folder
    x = GetAttr(saveFolder)
    If Err.Number <> 0 Then
        MkDir saveFolder
        Err.Clear
    End If
    
    saveSubFolder = saveFolder & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "\"
    'detect folder
    x = GetAttr(saveSubFolder)
    If Err.Number <> 0 Then
        MkDir saveSubFolder
        Err.Clear
    End If

    Set olMsg = ActiveExplorer.Selection.Item(1)
    For Each objAtt In olMsg.Attachments
        objAtt.SaveAsFile saveSubFolder & objAtt.FileName
    Next objAtt
lbl_Exit:
    Set objAtt = Nothing
    Set olMsg = Nothing
    Exit Sub
End Sub
 
Thread starter Similar threads Forum Replies Date
S Emails fetching into Excel and auto generating Dashboard Using Outlook 2
G Outlook 2010 Locks up on Fetching Mail Using Outlook 8
Commodore Outlook 2007 stops fetching Facebook updates Using Outlook 5
GregS Outlook 365 blocked by Google popup Using Outlook 2
T How can we view Blocked email addresses Using Outlook 6
N Outlook 2010 Flag blocked for Safe Senders List???? Using Outlook 7
M Blocked Sender List @Domain Not Working Using Outlook 0
Diane Poremsky Add to Safe (and Blocked) Senders for Users New Slipstick.com Articles 0
R Blocked Top-Level Domain List Using Outlook 2
G Not able to send ANY emails due to a blocked list Using Outlook 2
M All e mails seem to be getting blocked BCM (Business Contact Manager) 7
N Blocked senders list disappears Using Outlook 4
C Outlook 2010 hyperlink blocked in Windows 7 Home Premium Using Outlook 2
L error 550 relaying blocked. This only applies to one person in my mailing list.____ 550 relaying blo Using Outlook 2
M Junk Mail filter not working for all blocked addresses Using Outlook 2
P Internal email being blocked as spam Exchange Server Administration 9
C How to open .lnk attachment which is been blocked by outlook Using Outlook 3
D Use of outlook blocked by stop symbol Using Outlook 2
K Outlook 2010 Blocked Hyperlinks Using Outlook 1
C blocked sender Using Outlook 2
R Hyperlinks Blocked In Outlook Using Outlook 2
B Save account and personal settings, and blocked and safe senders for transfer to a new computer or after reinstall Using Outlook 1
2 Large files being blocked during migratoin Exchange Server Administration 1
W Are Outlook 2003 and Windows totally compatable As I have problem with Blocked Senders List not blocking the blocked senders on that list??? Using Outlook 2
T Outlook 2010 links embedded in received emails are blocked Using Outlook 3
C Need to know how to allow a hyperlink to work from and email in outlook 2010. Currently they are blocked and telling me to check with administrator. Using Outlook 3
K Outgoing group e-mails blocked as spam Using Outlook 2
F Right mouse click drop down menu to add sender to blocked list does not work. Using Outlook 2
J Outlook 2007 IMAP Connection Blocked Using Outlook 4
O HOTMAIL blocked my account. Student following directions in book. What to do? Using Outlook 2
C Sender Filtering action: Stamp with blocked sender not working Exchange Server Administration 3
D Links in microsoft outlook been blocked. Using Outlook 1
D Hyper links are blocked Using Outlook 1
D When running MS Outlook 2007 Hyperlinks blocked in emails Using Outlook 1
S #5.7.1 smtp;554 5.7.1 The file winmail.dat has been blocked Exchange Server Administration 12
J I inadvertenly blocked MS Outlook from opening as whenever I opened a program mu user settings would ask me if I wanted to open it. Now it states it Using Outlook 8
C JUNK E-MAIL/BLOCKED SENDERS LIST Using Outlook 2
C outlook does not filter blocked sender emails to junk folder anymore Using Outlook 3
D Blocked sender list not alllowing me to add more than 17 addresses. Using Outlook 4
S 0x800CCC69 Outlook Express This account is currently blocked from sending messages.__ Using Outlook 1
J e-mail blocked by microsoft hotmail servers, please unblock my account. Using Outlook 3
S %0d%0a characters are getting blocked in Outlook Web Access (OWA) browser based tool Using Outlook 2
D Outlook has begun delivering blocked senders mail to inbox Using Outlook 8
P This account is currently blocked from sending messages Using Outlook 1
S Outlook blocked access in archive.pst Using Outlook 8
A Hyperlinks blocked in outlook Using Outlook 8
D "Outlook has blocked access to this form template file. Outlook VBA and Custom Forms 3
A Attachments.Delete Outlook VBA and Custom Forms 3
M Deleting attachments does not reduce file size Using Outlook 0
L unblocking attachments before sending Office 365 Advanced Protection Using Outlook 0
Similar threads


















































Top