|
-
Jan 25th, 2006, 08:17 AM
#1
Thread Starter
Lively Member
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
-
Jan 25th, 2006, 11:00 AM
#2
Re: reference current slected attachment of an email
You would use the .Attachments collection of a MailItem object.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 26th, 2006, 11:22 AM
#3
Thread Starter
Lively Member
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
-
Jan 26th, 2006, 12:03 PM
#4
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 27th, 2006, 04:24 AM
#5
Thread Starter
Lively Member
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
-
Jan 27th, 2006, 09:55 AM
#6
Re: reference current slected attachment of an email
I'm not sure. You will probably have to test it to see.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 27th, 2006, 10:14 AM
#7
Thread Starter
Lively Member
Re: reference current slected attachment of an email
cheers,
i will test it once i have sorted all of my other problems, phew
many thanks
jamie
-
Jan 27th, 2006, 10:17 AM
#8
Re: reference current slected attachment of an email
No problem. Could you post back with your findings so we will know too?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|