Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook 2003 - Count how many attachments on e-mail

Status
Not open for further replies.

johnisotank

Technical User
Aug 8, 2008
258
GB
Hi,

could someone tell me how to get the count of attachments on the 'CURRENTLY SELECTED' Email. i.e regardless of what folder I am in it will use the email which has been selected (not any that are open in separate windows)

I have tried:

Code:
Application.ActiveInspector.CurrentItem.Attachments.Count

but it always shows as 0

Thanks
John
 





Hi,

This is right out of Outlook Help (with a little modification), after a little digging. I know next to nothing about the Outlook Object Model, but this looks like it might get you on the right track...
Code:
Sub GetSelectedItems()
    Dim myOlApp As New Outlook.Application
    Dim myOlExp As Outlook.Explorer
    Dim myOlSel As Outlook.Selection
    Dim MsgTxt As String
    Dim x As Integer
    MsgTxt = "You have selected items from: "
    Set myOlExp = myOlApp.Explorers.Item(1)
    Set myOlSel = myOlExp.Selection
    For x = 1 To myOlSel.Count
        MsgTxt = MsgTxt & myOlSel.Item(x)[b].Attachments.Count[/b] & ";"
    Next x
    MsgBox MsgTxt
End Sub

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top