I have added a menu item to the Personal Actions menu by creating a CustomAction like so:

    Title="My Link"
    Description="This is my custom link."
    <UrlAction Url="http://www.example.com/" />

I want that URL to open in a new window. I have tried this in the UrlAction,

<UrlAction Url="javascript:window.open('http://www.example.com/', '_blank');" />

but it causes the first window's content to be replaced with the text "[object]". Is there a better way to do this?

EDIT: When I run it with Firebug open, the behavior is slightly different. The first window's URL changed to "javascript:window.open('http://www.example.com/', '_blank');" and its content changed to "[object Window]".

  • @FalakMahmood: Yes, in 2010.
    – Jeremy
    Commented Jan 9, 2013 at 0:54

2 Answers 2


It should work:

<UrlAction Url="javascript:void(window.open('http://www.google.com','_blank'))"/>
  • Let's delete the comments :) Commented Jan 9, 2013 at 1:36

Here is an excerpt from the msdn page that seems to achieve what you are looking to do

 <CommandUIHandler Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}" CommandAction="javascript:window.open('http://www.bing.com/search?q='.concat(escape(document.title)))" />

And this is the link to where I found it http://msdn.microsoft.com/en-us/library/hh500259(v=office.14).aspx#odc_sp14_ta_AddCustomActiontoDisplay_CustomActionElements

Hope its what you need

  • I'm not quite sure where to put the CommandUIHandler element. I'm not adding a ribbon button, which might be the problem.
    – Jeremy
    Commented Jan 9, 2013 at 1:09
  • It would go inplace of the <UrlAction> although UrlAction should be working
    – user13186
    Commented Jan 9, 2013 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.