2

In HTML, If i use following link in anchor tag:

a href = "http://gugla.com/maadu.docx" target="_blank"

It opens document by opening new tab, downloading and close new tab itself.

As we need to use document for editing on download so Sharepoint team has given following URL:

a href = "ms-word:ofe|u|http://gugla.com/maadu.docx" target="_blank"

This opens document in editing mode on all browsers in word; but but but when document is saved after editing in word;; we see that "Browser Tab remained open and we need to close it manually". enter image description here

Note: This link is present in iframe so i could not remove target blank as it will show "leave page stay on page" dialog which is also not required.

UPDATE: Created fiddle for my use case http://jsfiddle.net/qxhzdmu6/ The link is not actual document but situation is same when word opens enter image description here

then it forgets there is tab at background

fatherazrael
  • 5,511
  • 16
  • 71
  • 155
  • Check this [link](https://stackoverflow.com/questions/13695537/opening-and-closing-a-new-tab-when-downloading). I have not tested it but it might help you – Daniel Attard Mar 11 '19 at 06:47
  • @DanielAttard: Thanks, The situation is generated on fiddle you can refer here http://jsfiddle.net/qxhzdmu6/ – fatherazrael Mar 11 '19 at 06:51

1 Answers1

2

Try setting the link target to a hidden iframe that you leave on the page. Can't test on my OS, so let me know if this works for you.

<a href="ms-word:ofe|u|http://gugla.com/maadu.docx" target="myframe">Download</a>

<iframe style="background: transparent;" id="myframe" name="myframe" src=""></iframe>


Aaron
  • 1,093
  • 8
  • 13