vLookup to Doc library – open docs in Chrome

Forums vLooup for SharePoint vLookup to Doc library – open docs in Chrome

Viewing 1 reply thread
  • Author
    Posts
    • #15298
      Gerard Graham
      Participant

      Hi there

      I have a list and a vlookup to a library of documents. In IE, clicking on the name of a document results in the document being opened from the library so that changes can be saved directly. The behaviour in Chrome from the vLookup is to download the document to the local temp folder so that changes would not automatically be saved to the document in the library. Accessing the same document in Chrome directly from the library opens the document for editing.

      Anyone know of a way of changing the behaviour of the link in the vLookup in Chrome to open the document for editing?

      Thanks

      Gerry

    • #15352
      Alexander Bautz
      Keymaster

      Hi,
      You can try adding this code to the Custom JS in DFFS:

      function openWordAndExcelFiles(a,item){
          var docName = item.get_item("FileLeafRef");
          var link = makeAbsUrl(item.get_item("FileDirRef") + "/" + docName);
      	switch(item.get_item("DocIcon").toLowerCase()){
      		case "docx":
      			a = "<a href='ms-word:ofe|u|"+link+"'>"+docName+"</a>";
      		break;
      		case "xlsx":
      			a = "<a href='ms-excel:ofe|u|"+link+"'>"+docName+"</a>";
      		break;
      	}
      	return a;
      }

      Then use this in the “Special configuration” for the field “FileLeafRef” in the viewfields section in vLookup config:

      {"function":"openWordAndExcelFiles"}

      PS: This URI scheme only works with Office 2010 SP2 and newer.

      Alexander

      • This reply was modified 7 years, 2 months ago by Alexander Bautz. Reason: Fixed open method for excel files
Viewing 1 reply thread
  • You must be logged in to reply to this topic.