Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add_In sought (OL 2003)

    Does any body know of a free addin, which after deleting a (large) attachment to save space, automatically adds a line to the message body stating the name of the attachment that was removed?

    The idea that one saves most attachments anyway, so they do not necessarily have to be saved with the message in the PST, both sent and received. On the other hand one would like to keep track of what attachments were sent/received with the message.

    TIA, Teunis

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add_In sought (OL 2003)

    See <post:=443,421>post 443,421</post:>.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Add_In sought (OL 2003)

    This version of the attachment to that post has a couple less bugs. (I need to update the attachment to that post.)
    Attached Files Attached Files
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    Hans and John,

    Thanks a lot. I am going to use it and let you know.

    Regards, Teun

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Add_In sought (OL 2003)

    In the event it isn't what you are looking for, MapiLabs and Sperry have attachment managers worth looking at.
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Add_In sought (OL 2003)

    I have a little VBA procedure I use to strip large attachments from Exchange server delivery confirmations. It doesn't save before deleting, since I always have the sent messages elsewhere. Also, it doesn't have an interface, simply operating on the open message or selected messages. If you think it would help, I can post it when I return to the office.

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    Jefferson,

    Thanks, but I don't use an exchange server since I work from home or on assignments away from our headoffice using my personal laptop.

    Regards,
    Teunis

  8. #8
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    John,

    I did a little googling and found there are many managers, including those mentioned by you. None of them free however, so I'll try your thing first, even though I don't need all the bells and whistles. But it'll have to wait till the weekend.

    Regards, Teunis

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Add_In sought (OL 2003)

    Hi Teunis, poor choice of wording on my part. It removes attachments from delivery confirmations I receive from my mail server, which happens to be Exchange. The script doesn't actually care what kinds of messages or attachments they are, that just happens to be where I use it.

  10. #10
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    Jefferson,

    In that case, please let me try it, as long as it adds the name(s) of the attachment(s) to the message so I know what files they were. I can understand that some people want to know which version etc. But I don't need that.

    Regards, Teun

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Add_In sought (OL 2003)

    This code will remove the attachments from the targeted message and add a notation with their names. Please note that it will first try the "active message," so close any messages you don't want altered. There is no "undo" for this, so you might test it on duplicates to get the idea.

    <code>Sub AttachStripAndAnnotate()
    ' Jefferson Scher 3/8/07 based on RemoveRelayedMessageAttachment [rev. 10/21/06]
    Dim msg As Outlook.MailItem, blnLoop As Boolean, intCounter As Integer, _
    strInsert As String, intSelCount As Integer
    blnLoop = False
    If Inspectors.Count > 0 Then
    ' Go to work on this "message" if it is a mail item
    If ActiveInspector.CurrentItem.Class <> olMail Then Exit Sub
    Set msg = ActiveInspector.CurrentItem
    Else
    ' Try to clean selected message(s)
    With ActiveExplorer
    Select Case .Selection.Count
    Case 0
    Exit Sub
    Case 1
    If .Selection(1).Class <> olMail Then Exit Sub
    Set msg = .Selection(1)
    Case Else
    blnLoop = True
    intSelCount = 1
    If .Selection(intSelCount).Class <> olMail Then Exit Sub
    Set msg = .Selection(intSelCount)
    End Select
    End With
    End If
    Do
    strInsert = vbNullString
    With msg.Attachments
    For intCounter = .Count To 1 Step -1
    If LCase(Right(.Item(intCounter).FileName, 4)) = ".msg" Then
    strInsert = strInsert & vbCrLf & .Item(intCounter).DisplayName & " {message item}"
    ElseIf LCase(.Item(intCounter).FileName) = LCase(.Item(intCounter).DisplayName) Then
    strInsert = strInsert & vbCrLf & .Item(intCounter).DisplayName
    Else
    strInsert = strInsert & vbCrLf & .Item(intCounter).DisplayName & _
    " {File name: " & .Item(intCounter).FileName & "}"
    End If
    .Item(intCounter).Delete
    Next
    End With
    If strInsert <> vbNullString Then
    If msg.BodyFormat = olFormatHTML Then 'Added 3/8/07
    msg.HTMLBody = Replace(msg.HTMLBody, "</body>", _
    "<p style=""border-style:double; border-width:3px; padding:4px 8px;"">" & _
    "Attachment(s) removed: " & vbCrLf & _
    Replace(strInsert, vbCrLf, "" & vbCrLf) & "</p></body>", , , vbTextCompare)
    Else
    msg.Body = msg.Body & vbCrLf & vbCrLf & String(60, "=") & vbCrLf & _
    "Attachment(s) removed:" & vbCrLf & strInsert
    End If
    End If
    If msg.Saved = False Then msg.Save
    If blnLoop = False Then Exit Do
    intSelCount = intSelCount + 1
    With ActiveExplorer
    Do
    If .Selection(intSelCount).Class = olMail Then
    Set msg = .Selection(intSelCount)
    If .Selection.Count = intSelCount Then blnLoop = False
    Exit Do
    Else
    If .Selection.Count = intSelCount Then
    Set msg = Nothing
    Exit Sub
    End If
    intSelCount = intSelCount + 1
    End If
    Loop
    End With
    Loop
    Set msg = Nothing
    End Sub</code>

    Hope this helps.
    Attached Images Attached Images

  12. #12
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    Jefferson,

    Thanks. I tried it and it does what I wanted, almost perfect for my purpose. One thing: the "removed message" is at the end of the message body. If it is a long thread it's not very handy because how does one know there was an attachment in the first place?
    1) How to move it to the top of the message?
    2) How to save this macro? I have some experience with Excel macros which one can save as *.bas files, but OL macros?
    3) Another thing is that the incoming message sometimes hardly reduces. Outgoing messages behave much nicer, they shrink to almost nothing. Is that a well-known thing?

    Regards, Teunis

  13. #13
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Doorn, Netherlands
    Posts
    311
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add_In sought (OL 2003)

    Jefferson,

    One more. After stripping the attachment using your VBA, OL does not ask me if I want to save it, whereas if I do it manually it always asks me if I want to save. Now why would that be? Is the attachment really stripped from the message, in particular since my experience is that (sometimes?) the size is not reduced at all.

    Regards, Teun

  14. #14
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Add_In sought (OL 2003)

    <hr>1) How to move it to the top of the message?<hr>
    The part of the code that inserts the message is here:

    <code>If msg.BodyFormat = olFormatHTML Then 'Added 3/8/07
    msg.HTMLBody = Replace(msg.HTMLBody, "</body>", _
    "<p style=""border-style:double; border-width:3px; padding:4px 8px;"">" & _
    "Attachment(s) removed: " & vbCrLf & _
    Replace(strInsert, vbCrLf, "" & vbCrLf) & "</p></body>", , , vbTextCompare)
    Else
    msg.Body = msg.Body & vbCrLf & vbCrLf & String(60, "=") & vbCrLf & _
    "Attachment(s) removed:" & vbCrLf & strInsert
    End If</code>

    In the HTML case, it's a little complicated to predict the exact text of the opening <body> tag. This may vary with the stationery. It would take me some time to think through the best way to insert the next paragraph at the top of the body.

    In the plain text/RTF case, you should be able to reverse the order of the elements in the assignment:

    <code> msg.Body = "Attachment(s) removed:" & vbCrLf & strInsert & _
    vbCrLf & String(60, "=") & vbCrLf & vbCrLf & msg.Body</code>
    <hr>2) How to save this macro? I have some experience with Excel macros which one can save as *.bas files, but OL macros?<hr>
    If you create a new module in Outlook, you can export it to a .bas file using the same technique as in Excel. Probably better not to use the ThisOutlookSession module; reserve that for special occasions.
    <hr>3) Another thing is that the incoming message sometimes hardly reduces. Outgoing messages behave much nicer, they shrink to almost nothing. Is that a well-known thing?<hr>
    I'm not sure why the size isn't reduced. Here is where the change is supposed to be saved:

    <code>If msg.Saved = False Then msg.Save</code>

    You could drop the test and just always do <code>msg.Save</code> and see whether that makes any difference.

  15. #15
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Add_In sought (OL 2003)

    The background Outlook PST compression routine may not immediately reduce message size, or may never reduce message size.
    -John ... I float in liquid gardens
    UTC -7ąDS

Page 1 of 2 12 LastLast

Posting Permissions

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