Reading Pane Context Menu VBA Help

P

Paul

I'm an experienced VBA Excel programmer, but am new to Outlook. I need
some help adding a custom menu item to one of Outlook's pop up context
menus.

I hope I can word the appropriate question here.

I have Outlook 2003 installed locally. It uses our corporate network
mail servers. Our administrators have set up the Outlook reading pane
to display a "windows messenger" icon next to the sender's name and
email address at the top of the pane. If you click the icon or right
click the senders name, a pop up menu appears showing several of the
senders properties from our corporate ldap source (e.g., name, business
phone, location, etc.). In addition Outlook provides other menu items
in the pop up like: additional actions, create rule, lookup outlook
contact, and outlook properties.

I would like to insert a custom menu item in this pop up. It would use
the senders name to essentially follow a hyperlink to a web page.

Could you outline how I might programmatically insert this custom menu
item (couldn't find the name/id for the pop up). Does Outlook have a
FollowHyperlink method which would bring up the web page?

Thanks Very Much,
Paul Katz
 
M

Michael Bauer [MVP - Outlook]

Am 3 Aug 2006 16:42:22 -0700 schrieb Paul:

In Outlook < 2007 you don´t have full control over the contex menu. Here´s a
sample how you might work around it:
http://www.outlookcode.com/threads.aspx?forumid=4&messageid=18141

OL does not have a FollowHyperlink method. You could use the Shell instead:

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Sub ShowWebSite(Site As String)
ShellExecute 0, "open", Site, vbNullString, vbNullString, 1
End Sub
 
P

Paul

Thanks - I'd settle for adding to the "Additional Actions" persona
submenu. Could you point me to an example or two? The MS link didn't
really say too much.
 
A

asidden

Hi, Paul

As You could read in MSDN article I've mentioned earlier, Smart Tag You
need to use to add a custom menu item to "Additional Actions" submenu
is #PersonName (urn:schemas-microsoft-com:eek:ffice:smarttags#PersonName).
So, You have to expand existing system Smart Tag with Your custom
actions. As far as I've understood from Your the very first post - you
need to create a menu item, which can take user to some web-page,
depending on his name. There are 2 possible ways to implement this
stuff: expand Smart Tag with special-formatted XML or with the help of
Smart Tag DLL, which You'll need to implement using C#, VB.NET
languages or unmanaged VC++ with ATL (if You're against .Net technology
at all :) ). (From my experience, I can tell you only that using .Net
will be the best decision, because Smart Tag DLLs implemented with
unmanaged VC++ have a little bit strange behaviour in the latest Office
applications). The decision which way to use (XML or DLL) depends on
what type of target URL You need and how it depends on contact's name.

The following links contains enough information about Smart Tag XML &
DLL developing:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office06072001.asp

http://search.msdn.microsoft.com/se...=0&tab=0&query=Developing+Smart+Tag+Solutions

Good luck

If You'll have any problems with implementation just let me know
 
P

Paul

Thanks so much for the info.

I was able to add a custom action to #PersonName via XML, and submit a
web query of the form
http://directory.corporate.com/search?name={TEXT}

Two more questions:
1. does the #PersonName smart tag expose any other fields besides
{TEXT}? (e.g., like {UID} for a unique user id),
2. can I open a url in it's own window? Right now the url comes up in
the first available browser currently opened.

Thanks again,
Paul
 
A

asidden

Hi there, Paul

According to Smart Tag SDK Documentation, if You implement Your Smart
Tag via XML only next dynamic values are accessible for YOU:

{LCID}- an integer corresponding to the user's current user
interface language lcid.

{TEXT}- the smart tagged text from which the action was initiated.
Smart tag text is encoded for HTTP posting. This means that spaces are
converted to %20s, and so forth.

This is so, because XML allows to implement only the simpliest Smart
Tag Actions. If You want anything more difficult - implement Your Smart
Tag as DLL - this really opens the gate to the real world :).
 
K

kedar

HOW HAVE YOU obtained context menu of Preview/Reading pane
please paste some sample code that worked with you
i'm developing in vb.net and want to have my menuitem in context menu
of previewpane
so that right click on from,to ,attachement can give me my menuitem
added in context menu..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top