Visio document imported into a SharePoint VisioWebAccess webpart : open links in new tab or window
Hello.
I'm using a SharePoint Server 2010, with a Visio Web Access WebPart.
With Visio 2010, I created a vdw document which I put in this webpart.
This works very well, but i have some hyperlinks which I want to be opened in a new tab (or a new window), so that he SharePoint page won't be replaced by the target page.
So, in Visio, I tried to modify the ShapeSheet of each hyperlink, by setting the "NewWindow" to true. Unfortunately, it does not work : links are replacing the current page.
I found nothing on the web that could give me a trick to do this.
Has anyone an idea ?
Thanks a lot
_David
Hello _David C,
You can create some JavaScript code that will open the hyperlink in a new window. Here is a JavaScript sample that will open the first hyperlink applied to a shape in a new browser window. I have tested it in both IE and FireFox.
<script type="text/javascript">
// Declare the global variables for the script, for the Visio Web Access Web Part, the active page in the Web Part,
// the shapes on the active page, and the shape on the page without hyperlinks.
var vwaControl;
var vwaPage;
var vwaShapes;
var coldShape;
// Add a handler to the AJAX Sys.Application.load event.
Sys.Application.add_load(onApplicationLoad)
function onApplicationLoad()
try{
// Capture a reference to the current instance of the Visio Web Access Web Part.
// Add a handler to the 'diagramcomplete' event.
vwaControl= new Vwa.VwaControl(getVWAWebPartID());
vwaControl.addHandler("diagramcomplete", onDiagramComplete);
catch(err){
alert(err);
function getVWAWebPartID()
// Search all of the <div> tags on the page to find the div tag with the ID of the VWA Web Part.
var divArray = document.getElementsByTagName("div");
var webPartElementID;
for (var i = 0; i < divArray.length; i++) {
var node = divArray[i];
if (node.className == "VisioWebAccess")
webPartElementID = node.parentNode.parentNode.id;
break;
return webPartElementID;
function onDiagramComplete()
try{
// Set the vwaPage and vwaShapes variables to the active page and the shapes collection on that page, respectively.
vwaPage = vwaControl.getActivePage();
vwaShapes = vwaPage.getShapes();
// Set the 'cold shape' for the current active page in the drawing.
selectColdShape();
// Remove the handler from the shape selection changed event and then add it back to the event.
vwaControl.removeHandler("shapeselectionchanged", onShapeSelectionChanged);
vwaControl.addHandler("shapeselectionchanged", onShapeSelectionChanged);
catch(err)
alert(err);
onShapeSelectionChanged = function (source, args)
try{
// Get the array of hyperlinks from the selected shape.
var vwaShape = vwaShapes.getItemById(args);
var newURLArray = vwaShape.getHyperlinks();
var newURL;
// Check to see whether the shape has any hyperlinks.
if (newURLArray.length > 0)
newURL = newURLArray[0].value;
// Check to see if the hyperlink goes to another page in the drawing.
if (newURL.indexOf('vdw') < 0)
// Open the hyperlink in a new window.
var newWindow = window.open(newURL);
else
// Set the active page to the new page.
setNewPage(newURL);
catch(err)
alert(err);
function selectColdShape() {
try {
// Set variables with the names of shapes on the pages that do not contain hyperlinks.
// Customize the values for these variables to fit your web drawing.
var coldShapePg1 = "Sheet.6";
var coldShapePg2 = "Sheet.10";
// Check to see if the coldShape exists on this page.
if (vwaShapes.getItemByName(coldShapePg1)) {
// Set the active shape to the shape without hyperlinks on page 1.
coldShape = vwaShapes.getItemByName(coldShapePg1);
vwaPage.setSelectedShape(coldShape.getId());
else if (vwaShapes.getItemByName(coldShapePg2)) {
// Set the active shape to the shape without hyperlinks on page 2.
coldShape = vwaShapes.getItemByName(coldShapePg2);
vwaPage.setSelectedShape(coldShape.getId());
catch (err) {
alert(err);
function setNewPage(pageId) {
// Set the active page in the drawing to the page ID passed in as argument.
var indexOfAmp = pageId.indexOf("&");
var page = pageId.slice(6, indexOfAmp);
vwaControl.setActivePage(page);
</script>
Note that this code requires that each page have a "cold shape" that does not have any hyperlinks applied to it. In my test drawing, I added a hidden shape (in ShapeSheet, Width = 0, Height = 0) that did not have any hyperlinks. This is because the Vwa.shapeselectionchanged
event fires when you switch pages, which creates the possibility that the JavaScript code will open a new window when you change pages in the viewer.
If you are not familiar with the Visio Services JavaScript Object Model, I suggest that you check out the following resources:
http://blogs.msdn.com/b/visio/archive/2010/02/21/the-visio-services-javascript-mashup-api.aspx
http://msdn.microsoft.com/en-us/library/ff394649.aspx
http://msdn.microsoft.com/en-us/library/ff394600.aspx
I hope that this helps,
E. Schmidt, Technical Writer
Microsoft Corporation
Similar Messages
-
Automatically open a tab by typing in address box.
You can middle-click the Go button on the location/address bar to open the URL in a new tab and press Alt+Enter.
You can search the Add-ons website to see if there is an extension that includes this feature. -
When I clicked on a link, it opens into a new window. I would prefer that it opens as a new tab. Does anybody know how to change this?
ThanksTools > Options > Tabs: [X] "Open new windows in a new tab instead"
You can look at the browser.link.open_newwindow prefs on the about:config page if you want to divert all JavaScript window.open() calls to a new tab.
* http://kb.mozillazine.org/browser.link.open_newwindow.restriction (0)
* http://kb.mozillazine.org/browser.link.open_newwindow (3) -
Editing a document imported into Microsoft Word
Anyone know if there's a way to edit a scanned document that is imported into Microsoft Word? When I scan it it saves as either a JPEG file or PDF.
Thanks!I've got a feeling that he means editing a textual document that was scanned in. In that case, OCR software would be needed. I'm not familiar with any on the Mac side, but I know Omnisoft works pretty well on the Windows side.
-
Open links in iframe in parent window tab of sharepoint page
i have a sharepoint page where i have a html form editor webpart page in that iframe section which displays google page
But i want whatever results i get from google results page in iframe on click of it to open in new tab of my parent window not inside my iframe section
Any pointer wil be helpfulNot possible
--Cheers -
I use google mail for work and personal mail. When using my Mac, I click on a document (PDF, Excel, etc) in an email message and it opens a preview of that document in a new tab.
On my Windows PC, I do the same thing and it just sits there. I have checked the pop-up blocker and some of the settings but can't figure out why it works in one and not in another.
Any help is appreciated.Check if this KB might be of any help:
https://support.mozilla.org/en-US/kb/tab-preferences-and-settings
Thanks!
Om Prakash -
Once I made Firefox my default browser, some of the documents saved on my desktop have the Firefox logo on them. When I opened the document, the top of the window has all of these "new tab" quickly and continuously running across the top, up to 131 before it stopped. So, how do I remove the logo from all of my documents?
If there is currently no file handler application that handles PDF files then the Firefox updater/installer registers Firefox as the default application to handle PDF files and thus they get a Firefox icon (Bug 452254).
You can right-click a PDF file in Windows Explorer and use the open with dialog to change the default application to the Adobe Reader or your preferred application to handle PDF file.
If the icon doesn't change to the icon of that application then you may have to change the icon on the desktop via other means.
*[https://bugzilla.mozilla.org/show_bug.cgi?id=452254 bug 452254] - Register for audio/video .ogg and .pdf file handlers if nothing else has
<i>Please do not comment in bug reports<br>https://bugzilla.mozilla.org/page.cgi?id=etiquette.html</i>
See also "FileTypesMan - Alternative to 'File Types' manager of Windows":
*http://www.nirsoft.net/utils/file_types_manager.html -
Large Word document imported into Pages with "Section Break Problems"
Hi there,
I am importing a large Word document with many photos (>250 pages) into Pages. Now, the problem is that when using the "page thumbnail" window to the left it marks all my windows with a yellow border.
This means that I can't duplicate single pages - it will duplicate the whole stuff. Same thing for delete.
I can go to the last character of each page and insert a "section break". This creates single pages. But it seems a bit odd to me, and with >250 pages, this is quite some work too.
Any idea what I can do to solve quickly the issue?
Thanks for any hints!Sections are what they say they are natural breaks in the document.
Each section usually having headers footers and other basic content in common.
Effectively just like chapters in a book or specifically designed pages in a magazine or report.
If your text naturally flows from one page to the next then they should stick together.
If on the other hand you are treating them all like single leaves of paper to be shuffled around, then you need a section break at the end of each page.
3 ways you can quickly do this:
1. There is a unique start to each page such as a return followed by a particular word. You can search on this combination replacing it with a section break followed by the word.
2. You can make a short cut to do this from the keyboard
3. You can copy a section break and paste it at the end of each preceding page.
4. You can transfer by copying and pasting the content into a Layout mode document where every page is its own section.
As with most work, planning, organisation and thinking before you leap, pays off in the long run.
Peter -
Document "tiles" into lower right corner when opened
If this is a duplicate post, I apologize . . .I've not read all the posts in the forum, but I'm in a time crunch.
My document looks as though it will open normally, page comes up normally, and then it "tiles" down so that upper left corner of the page is in the lower right corner. You can literally watch the page step down from a full page until only about a 1" x 2.5" section is visible. It only prints that lower right corner, and that's all that is viewable. Also, even though the document is multiple pages, it only shows what appears to be the last page, and says the document is "1 of 1 pages" When it "tiles" down, it appears that there are multiple pages behind the page shown, but we cannot get to them. I've tried opening it in Adobe 9.3 and Adobe 7. I'm not a whiz at Adobe, but this is the first time I've seen this. Any ideas?? Thanks in advance.I also noticed unified and unknown on the iPhone. How can I make these merge with the contact that is already there so there is only one entry?
-
It seems that recent additions to my iTunes library are not available for download to my (or my son's) iphone - other albums by the same artist are available.
Any help is appreciated...Audiobooks (and ringtones) are currently a one-time only download from the store. If you don't have it on a backup of your downloads then you can try contacting iTunes support and see if they will grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
-
Hi there,
I canNOT use SharePoint Designer nor do I have access to server to change any 14 hive files.
I have a SharePoint 2010 List with a field of type Hyperlink. I need these links to open in New Window. Only links with-in this LVWP should open in new window (and not links on Quicklaunch or top nav).
Any clues how to achieve this please? JS is okay.
Thanks.Hello,
The good news is that you're not the first to have those requirements!
Here's the JavaScript:
<script>
var allLinks = document.querySelectorAll("table.ms-listviewtable tr td a");
for(var i=0; i<allLinks.length; i++){
if(allLinks[i].onclick == null){
var targetUrl = allLinks[i].href;
targetUrl = targetUrl.indexOf("?") > -1 ? targetUrl + "&isDlg=1" : targetUrl + "?isDlg=1";
allLinks[i].href= "javascript:var options = {width:500, height:300, url:'"+targetUrl+"'}; SP.UI.ModalDialog.commonModalDialogOpen('"+targetUrl+"', options);";
</script>
This script can be saved to a text file and uploaded to a document library. You can then add a content editor web part below your list view web part (so that it doesn't execute until after the list view has loaded) and set the "content link"
property of the web part to be the path to the uploaded text file.
The solution was originally posted here:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8ca275df-1d9c-4d0f-a624-c0531fda069a/how-to-open-model-dialog-onclick-of-list-item-hyperlink-column?forum=sharepointdevelopmentprevious -
Firefox does not crash.
It is not unresponsive.
New websites can not be loaded.
Websites currently open in tabs are still able to be used and continue to work fine... all links in running websites seem to work.
Google is able to be loaded in a new tab (possibly because it had been run previously), search works but searched items can not be loaded.This forum is for the Shockwave Player - the plugin for running Adobe Director files in a browser. You need a forum for the Flash Player - the Shockwave Flash plugin. Blame Macromedia for confusing the name space of the 2 separate and distinct plugins
-
Codes to open Video or Documents from Library to open in new tab by default
Hi
I am using Sharepoint 2013 Office 365 web version to build and edit the TeamSite.
Is there a way using SharePoint Designer or Scripts to Open the Video or Documents from the Document/Asset Library to open them in new tab or window when clicked?
Currently, When clicking on video it opens in the same IE window, I could change the Thumbnails view to All asset view then right click and open it in a new windows. But I want this to happen by default when clicking the link
I would appreciate your view in detail.
Regards,
DanielHi,
If you just want to open the video or document in a new tab, yes, it can be achieved with JavaScript or JSLink.
However, it is not a recommended behavior to add script for such a functionality into a page cause it is more like an option of browser behavior and it would
make the pages in a site difficult in maintenance.
The easiest way I think, you can perform a “Middle click” or “Ctrl + Left click” to open the video or document in a new tab.
To achieve it using JavaScript, we will have to modify all the “onclick” properties of the items in a library after the page loaded which should be an extra burden of your
browser.
Here is a link with script demo about how to open a link in new tab for your reference:
http://junestime.wordpress.com/2013/02/26/javascript-open-links-in-new-windowtab-in-sharepoint-2010/
Feel free to reply if there are any questions.
Best regards
Patrick Liang
TechNet Community Support -
Visio Webpart-links opens in new tab
Hi,
I have created a Visio-document with some shapes. I have set hyperlinks to other .aspx-files in the
SitePages-library on these shapes.
Everytime I click on a linked shape it opens in a new tab. How can I solve this?
For your information: The ShapeSheet in Visio is correctly set up. "NewWindow" is set to "False".
I have Sharepoint 365.
Thanks in advance!
ThomasHi Thomas,
According to your description, my understanding is that the hyperlink of
Visio document opens with new tab.
For my test, I create a rectangle with hyperlink
in a Visio document and set the NewWindow property of the hyperlink to false using VB coding as below:
Public Sub NewWindow_Example()
Dim vsoHyperlink As Visio.Hyperlink
Set vsoHyperlink = ActivePage.DrawRectangle(0,0,5,5).AddHyperlink
vsoHyperlink.Address = "http://www.microsoft.com/"
vsoHyperlink.NewWindow = False
End Sub
But this hyperlink opens in new tab in my SharePoint 2013 Online as your scenario. It is by default that SharePoint 2013 Visio Service deals with
the hyperlink of Visio document. There is no approach that Microsoft Visio keep the same location when it follows a hyperlink to open a Web page.
Reference:
http://msdn.microsoft.com/en-us/library/office/ff767738(v=office.15).aspx
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Visio Web Drawing opens all hyperlinks in new tab
Hi,
I created a diagram in Visio 2013 Professional. I saved the diagram as Visio Web Drawing to a Sharepoint document library. I use the web part Visio Web Access to display the diagram on a SharePoint page. The diagram contains some hyperlinks to other
SharePoint pages. However all the pages opens in a New tab.
How can I make the hyperlinks to open in the same window?
I set the Hyperlink.NewWindow property as FALSE in Visio, but it doesn't matter. It still opens in New tab.
I tried to make one hyperlink to another Visio page (in the same Visio file) by selecting sub-address, and this opens in the same window. If I make the hyperlink by paste the url to the SharePoint page in the Address Field, it opens in a New tab.
Can anyone help?It is by default that SharePoint 2013 Visio Service deals with the hyperlink of Visio document. There seams to be no approach that Microsoft Visio keep the same location when it follows a hyperlink to open a Web page.
Reference:
http://msdn.microsoft.com/en-us/library/office/ff767738(v=office.15).aspx
Courtesy:
Wendy Li
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.
Maybe you are looking for
-
Classic will no longer sync podcasts with video. I get sound only
Hi I was haveing a great time with my ipod. Watching podcasts of all sorts. Then it stopped syncing podcasts (music is fine). I got error messages sometimes saying cannot sync as disc cannot be found. Then out of the blue it sunk some podcasts but wi
-
Netbeans 4.1 and creation of javadoc failure. Also no api docs...
Hi people. I recently downloaded and installed Netbeans 4.1 over Netbeans 4.1 early access 1 and I got the two following problems that I didn't have before (the older version worked flawlessly): 1: I cannot create the javadoc html files from the sour
-
Bootcamp startup disk selection in Windows 7 does not reboot in Mac OS X
Hi! The bootcamp control panel lets me select which operating system too boot into but it doesn't seem to write the actual instruction to do so to the EFI, because everytime it boots me right back into Windows even when I choose to restart in Mac OS
-
How do I pair a new Mac mini (out of the box) to a Logitech keyboard
How do I pair a new Mac mini (out of the box) to a Logitech keyboard. According to the help desk it is not possible you need an Apple keyboard to complete the task this does not seem right as it states on the Apple website that the products can be mi
-
Subcontracting with the finished material to be given to the customer
dear all, I want to implement a scenario, in which i want do subcontracting. the material shall not be given by me but shall be ordered to another vendor who shall give it to the subcontractor, the subcontractor shall give the finished product to the