IE MenuExt scripting problem

Posted on 2007-10-18
Last Modified: 2013-12-08

We're trying to integrate IE with a document management package.

The plan is to add a reg key to HKCU\software...\Internet Explorer\MenuExt so that we could add 'Download file to Document Mangement' to the IE context menu for links.

We've added the key, and set it to point at a local html file that contains VBScript that will download the file, then ask a few questions before putting it into the documnet management system.
We've added this to MenuExt with a 'context' of 0x20 (Anchor), and if we right click on a URL in a web page, it appears and when selected runs the script. In the script. The script then grabs the URL using external.menuArguments.event.srcElement.href.

So, a URL in a page defined as:
<a href="">File Specification</a>
comes back to the script as Everybodies happy. Everybodies dancing.

Except there's a fly in the ointment.

If the URL is based on an image, instead of text, for example:
<a href=""><img src="/Images/doc.gif"></a>
Then we don't get the option on the context menu, as it's a different context menu, the one for images. We've tried adding it in the image context, using 0x2 (Images) on the reg key. When we do this, we get the option, but when we grab external.menuArguments.event.srcElement.href in the script, we get, not (which is what we want).

Anyone got any ideas? Either for a different context for the reg key, or a different way of getting hold of the correct URL when we put it on the image context menu.


Question by:Halibut
    LVL 65

    Accepted Solution

    Hi, I'm not too sure, but try outputting the

    to make sure you're catching an "A" tag, because that will have an href attribute.

    If you're catching something that is not an "A" tag (that is an "IMG" tag for example), try using



    Author Comment

    Many thanks, Rob.

    external.menuArguments.event.srcElement.parentNode.href was what I was looking for, in combination with a context of 0x2.


    LVL 65

    Expert Comment

    Oh yeah, true.  I forgot about the Context thing, which already defines which srcElement is being thrown at it, glad it worked.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
    Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
    This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
    Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now