Results 1 to 14 of 14
  1. #1
    New Lounger
    Join Date
    Dec 2003
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print list of attachments with email (xp)

    Thanks in advance for the help.

    I would like to include the names of the attachments when printing an email. I know when I receive an email in RTF, the attachments are listed in the body of the email, but both plain text and html emails don

  2. #2
    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: Print list of attachments with email (xp)

    Plain text messages should show the attachments (typically with big icons just below the subject line), but definitely HTML does not.

    Someone has posted a snippet of VBA code that adds the names of the attachments to the end of the message. This is a separate step you would run before printing. If that works for you, hopefully someone can readily locate that thread. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  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: Print list of attachments with email (xp)

    This may be the code Jefferson referred to. If you do not use HTML as your default editor, I think you can replace the blue code with the red code. May not work with Word as editor; Outlook's VBA model doesn't integrate well with Word. Note the warning about drafts. And I haven't tested it extensively.

    Public Function GetCurrentItem() As Object
    On Error Resume Next
    If TypeName(Application.ActiveWindow) = "Explorer" Then
    Set GetCurrentItem = ActiveExplorer.Selection(1)
    Else
    Set GetCurrentItem = ActiveInspector.CurrentItem
    End If
    End Function

    Sub PrintWithAttNames()
    Dim itmMessage As MailItem
    Dim strAttNames As String
    Dim intC As Integer

    On Error Resume Next
    Set itmMessage = GetCurrentItem

    If Not itmMessage Is Nothing Then
    With itmMessage
    If .Attachments.Count And _
    .GetInspector.EditorType = olEditorHTML Then
    <font color=blue> For intC = 1 To .Attachments.Count
    strAttNames = strAttNames & "Attachment: <TAB>" & _
    .Attachments(intC).FileName & ""
    Next intC
    .HTMLBody = .HTMLBody & "" & strAttNames</font color=blue>
    <font color=red> '.Body = .Body ' reset the body using default editor setting</font color=red>
    End If
    .PrintOut
    .GetInspector.Close olDiscard ' close without saving -THIS WILL DELETE DRAFTS
    End With
    End If
    Set itmMessage = Nothing
    End Sub

    Instead of the call to 'GetCurrrentItem', you could replace your default print button with one that calls the 'PrintWithAttNames' sub. And you can do more than the above sub in terms of formatting the HTML appearance of the list of attachments.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Cairns, Queensland, Australia
    Posts
    885
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15>Has this feature gone for ever, does anyone know?

    It was an extremely useful feature as in our office emails are often sent with standard attachments. Having to change the format every time is painful. We need Word as the editor for a good reason. <img src=/S/groan.gif border=0 alt=groan width=16 height=15>
    Granville

  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: Print list of attachments with email (xp)

    The problem is only with HTML formatted messages, and you can attach that code to your print button so the code solution is transparent. I do not have access to Outlook '03 but believe it has the same behavior.
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    John hi

    We are having the same problem whereby staff wish to have a list of attachments shown when the email is printed. I have copied your code but cannot seem to get it to work. When entering the code it gets hung up when telling it what to print where e.g see attachment

    Any suggestions?

    Cheers
    cheers

    Phil Carter

  7. #7
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    John

    Sorry I don't think I attached the gif
    cheers

    Phil Carter

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

    Re: Print list of attachments with email (xp)

    Some spaces are lost in the line you have attached; make sure the appropriate spaces from my original posting are included. If that doesn't help, post back.
    -John ... I float in liquid gardens
    UTC -7ąDS

  9. #9
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    John

    Here is the whole code.

    Cheers
    cheers

    Phil Carter

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

    Re: Print list of attachments with email (xp)

    Phil, on these lines you should <font color=red>not</font color=red> have the parentheses marked in red:

    strAttNames = strAttNames & <font color=red>(</font color=red>"Attachment: <TAB>"<font color=red>)</font color=red> & _
    .Attachments(intC).FileName & <font color=red>(</font color=red>""<font color=red>)</font color=red>
    Next intC
    .HTMLBody = .HTMLBody & <font color=red>(</font color=red>""<font color=red>)</font color=red> & strAttNames

    If after correcting these the syntax is not reporting errors but you have errors in running code, please show the line and error reported.

    Also, it saves less bandwidth if you simply copy the code into the text of your post rather than posting it as a graphic attachment. Use the '1-Click Tag Panel' to format text.
    -John ... I float in liquid gardens
    UTC -7ąDS

  11. #11
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    John

    Thanks again that seems to be better. The message I got seemed to suggest that I needed parenthesis.

    However, I now get the attached message when I try to run the macro.

    Another question , how do you attach the macro to the print button?
    cheers

    Phil Carter

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

    Re: Print list of attachments with email (xp)

    Phil, the parentheses suggestion was probably because you didn't have spaces around the ampersands ("&"). The VBE can get a little lost parsing those text string concatenations, which is what the ampersands are doing.

    I'm not getting that error message, I'll need to look into it.

    The manual way to attach it is a pain, compared to Word and Excel. Select View | Toolbars | Customize, in the Categories box select Macros, then from the Commands box drag the appropriate Macro to the TB. Then right click it and change the display, and copy the Print Icon button face to it, etc. When It's all working, delete the standard Print button.
    -John ... I float in liquid gardens
    UTC -7ąDS

  13. #13
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Print list of attachments with email (xp)

    Thanks again John

    I didn't mention I am trying to run this under Office XP(2002) but trialling it for our punters using 2003.

    Toolbar: I thought this would be the case.

    Where are you located? I start at 6:30am and if you are in Aus, boy that's an early start!
    cheers

    Phil Carter

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

    Re: Print list of attachments with email (xp)

    Phil, I'm running OL 2003 in my test, I have XP at home. Any Loungers who might know about that error message, please speak up.

    Check my Profile Bio, <!profile=JohnBF>JohnBF<!/profile>! I'm in the US, Mountain Time Zone, UTC -7 (7 hours behind UTC/GMT).
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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