Como fazer com que o Outlook não salve anexos de saída

0

Quando uma mensagem é enviada no Outlook, a mensagem é salva na pasta apropriada de itens enviados. Em um esforço para manter os tamanhos de caixa de correio pequenos, gostaríamos de ver se existe uma maneira de remover automaticamente quaisquer anexos das mensagens salvas de saída. Isso não precisa ser implementado por meio de políticas de grupo ou algo do tipo, é apenas algo que estamos investigando neste momento.

Isso é possível no Outlook 2010 ou 2013 (Windows 7 ou 8.1)?

    
por vaindil 24.09.2014 / 22:19

1 resposta

0

Fonte Remover anexos das mensagens

This question from Outlook user wanted to know how to remove several attachments from a message in one step.

I want to keep sent messages but not the attachments. Is there an easier method than clicking on the attachment to delete it? Better yet, can I select several sent messages and remove the attachments from all of the messages?

Outlook doesn't have this functionality built in so you'll need to use an add-in or VBA, but yes, it can be done.

See Attachment Management Tools for Outlook for add-ins or More Information for additional macros, including code samples that can save the attachments to the hard drive before deleting them from the message.

This code will work with sent or received messages, in any folder. To use, add the code to the VBA editor, select the messages that you want to delete the attachment from and run it.

Sub DeleteAllAttachmentsFromSelectedMessages()
    Dim myAttachment        As Attachment
    Dim myAttachments       As Attachments
    Dim selItems            As Selection
    Dim myItem              As Object
    Dim lngAttachmentCount  As Long

    ' Set reference to the Selection.
    Set selItems = ActiveExplorer.Selection

    '  Loop though each item in the selection.
    For Each myItem In selItems
        Set myAttachments = myItem.Attachments

        lngAttachmentCount = myAttachments.Count

    ' Loop through attachments until attachment count = 0.
        While lngAttachmentCount > 0
            myAttachments(1).Delete
            lngAttachmentCount = myAttachments.Count
        Wend

        myItem.Save
    Next

    MsgBox "All Done. Attachments were removed.", vbOKOnly, "Message"

    Set myAttachment = Nothing
    Set myAttachments = Nothing
    Set selItems = Nothing
    Set myItem = Nothing
End Sub
    
por 24.09.2014 / 22:31