reference current slected attachment of an email
hi again
if my terminology is a little wrong, then please excuse me
i have the following code which registers inspector events with newly created items so i can use thier events
Code:
Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
Set objInsp = Inspector
Select Case objInsp.CurrentItem.Class
Case olMail
Set objMailItem = objInsp.CurrentItem
Case olAppointment
Set objApptItem = objInsp.CurrentItem
Case olContact
Set objContactItem = objInsp.CurrentItem
Case olDistribution
Set objDistListItem = objInsp.CurrentItem
Case olJournal
Set objJournalItem = objInsp.CurrentItem
Case olPost
Set objPostitem = objInsp.CurrentItem
Case olTask
Set objTaskItem = objInsp.CurrentItem
End Select
End Sub
i also declare the holding objects (omailitem) with events, anyhow it works ok
one of these is the omailitem_open event which i add a few buttons to the tool bar of a new email.
one of these buttons is then used to digitally seal the attached document with our java classes. Integration with this ia done
what i need to know, is how to reference the a selected attachment from within oMailItem object
is there an event like oAttachmentSelection, so that i can capture the item selected.
many thanks
jamie
Re: reference current slected attachment of an email
You would use the .Attachments collection of a MailItem object.
Re: reference current slected attachment of an email
hi there
thanks for the response
i know how to reference the attachments collection, but what i need to know, is how to reference the event of an attachment selection to capture the id of the selected attachment, whihc i woul then use to reference it in the attachment collection (after saving the new mail)
i have read since posting this that attachments are added using the lcip board and that vb cannot access these files as it cannot access the clip board functions (sorry, on another pc, cant provide a link at thsi time)
the only other alternaitve which i have found, is a drag and drop dll, which allows you to drag the required attachment onto the control, which then uses a c++ ocx to access the file properties on the clip board.
bu if any one knows a different way then i woudl love to know
jamie
Re: reference current slected attachment of an email
If the email is already a saved one, you may be able to create a ItemChange event. Not sure if it will fire for each attachment added or only when its saved.
VB Code:
Public WithEvents AttachItems As Items
'Sync the item to AttachItems
'Then you can use its event.
Private Sub AttachItems_ItemChange(ByVal Item As Object)
End Sub
Re: reference current slected attachment of an email
cheers,
but can this be done with new emails?
i may have to get the user to first save the emial, then choose an attachment, but that is going to be a problem with the client
jamie
Re: reference current slected attachment of an email
I'm not sure. You will probably have to test it to see. :)
Re: reference current slected attachment of an email
cheers,
i will test it once i have sorted all of my other problems, phew :eek:
many thanks
jamie
Re: reference current slected attachment of an email
No problem. Could you post back with your findings so we will know too? :)