|
-
Apr 4th, 2005, 07:59 PM
#1
Thread Starter
Lively Member
vb.net outlook addin right-click attachment
I need create an add-in for outlook 2000
I'm trying to do it in vb.net.
What I'm trying to do is add another menu item, when
you right click on an attachment.
Say....
Open
Save As
MyFunction
blah
blah
properties
I have a few questions.
Is this possible using the outlook object model ?
http://msdn.microsoft.com/library/de...HV01049998.asp
If so, what object should I be researching ?
If anyone can share anything. thoughts, code snips, emotional troubles,
that would be great. I'm all ears.
Thanks
-
Apr 4th, 2005, 11:26 PM
#2
Re: vb.net outlook addin right-click attachment
I take it that this is only for the MailItems type. I believe that there is a way but is very complicated,
especially when you factor in the fact that you can have multiple Outlook Explorer instances.
Just about the only way for a MailItem is to use the Actions of a custom Outlook Form for it.
The major problem is that your form will have to be attached when or if you send or forward it. In doing so the
receipient will not be able to open the email if they dont have Outlook.
Its allot easier to add a toolbar buton or menu item.
If you want to do the context menu then you need to attach to the CommandBars collection and _OnUpdate
event of the commandbars object. Its in this event that you can add a new CommandBarButton to represent the
new menu item and attach it to the context menu commandbar. In 2002 and 2003 the CommandBar is called
"Context Menu". I dont know what it is for 2000 though.
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 
-
Apr 8th, 2005, 11:43 AM
#3
Thread Starter
Lively Member
Re: vb.net outlook addin right-click attachment
Thanks for your feedback. The adding to a context menu of an attachment does not seem very promising, since it the attachment object does contain a actions.add property.
I will just go with something like this....
VB Code:
Private Sub my_inspector_event(ByVal mInspector As Outlook.Inspector) Handles inspector.NewInspector
Dim objItem As Object
Dim objAction As Outlook.Action
If explorer.Selection.Count > 0 Then
objItem = explorer.Selection.Item(1)
If objItem.Class = explorer.Selection.Class.olMail Then
If objAction Is Nothing Then
objAction = m_objMailItem.Actions.Add
With objAction
.Enabled = True
.Name = "Send to Docket"
'.ShowOn = OlActionShowOn.olMenu
.ShowOn = OlActionShowOn.olMenuAndToolbar
End With
End If
End If
End If
objItem = Nothing
objAction = Nothing
End Sub
Though a new problem arose, and I don't know if I should ask in a new thread.
Basically, I don't know how to detect if a context menu already exist. So evertime, I open the email it keeps adding more buttons to it.
anyone know about this one ?
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
|