1

I'm using SP Foundation 2010, with severly limited development permissions. I'm operating as a site Owner in a user area, so access to Designer, Visual Studio, etc. is limited and I'm looking for solutions that can be accomplished with those constraints in mind.

We have a document library of about 2000 documents used by our help desk. About 95% of these documents are html and the remaining are PDFs, Word, Excel or PowerPoint.

When users select these documents from the list, I want the HTML to open in the browser, but all other documents to open in Acrobat, Word, Excel, PowerPoint, etc. The only parameter I can find is in Doc Library > adv settings, where I can choose to open docs in the browser or not. with that box, I can get them to open in the browser window or get prompted to download the file to the local desktop...which I defintely want to avoid. Hovever I can't seem to apply this to rule differently to documents in the same library.

Suggestions on how to do this? Is there some way i can drive that with document metadata, or do I need to put HTML in one library, and all non-HTML in another, and assign separate "open file" behaviors for each library?

Thanks

0

Try this question

The code posted was for PDFs I just used it on my site and it works well all you would need to do is modify the code below from .pdf to what ever extension you want.

<script src="https://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script><script>
$(document).ready(function() {
$("a[href$='.pdf']").removeAttr('onclick').attr("target","_blank");
   });
</script> 

And just place it in a Script editor web part on the page. The script editor is located here:

enter image description here

Be sure that your document library is set to open in client by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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