0

Background: We have a running index of files within an Excel workbook that we use to list and maintain our files and related attributes/categories. This workbook includes a data column with links to documents that exist in multiple document libraries across multiple sites.

Problem: We would like to create a single site that also contains "Link to Document" content types within the document library that link to the document listed in the Excel workbook.

Question: Is there a way to automatically generate the "Link to Document" content types within the document library by using the Excel workbook as the source? Having the links for the "Link to Document" and links within the Excel workbook connected to mutually update would be a nice benefit, but at the very least, I would like to simply use the Excel workbook to generate these "Link to Document" .url content types.

Any help would be much appreciated, as a good search here and on Google has netted no solution yet.

1 Answer 1

0

We believe there is no such built-in functionality to auto generate the "Link to Document" content types within the document library by using the Excel workbook as the source. You may need to develop applications, timer job .etc.

Here i share a demo about how to programmatically create a "Link to Document" item using SharePoint Rest API:

Endpoint:

/_api/web/GetFolderByServerRelativeUrl('library name')/files/add(overwrite=true, url='Testing.aspx')

Post Data:


"<%@ Assembly Name='Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %><%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %><%@ Import Namespace='System.IO' %><%@ Import Namespace='Microsoft.SharePoint' %><%@ Import Namespace='Microsoft.SharePoint.Utilities' %><%@ Import Namespace='Microsoft.SharePoint.WebControls' %><html xmlns:mso='urn:schemas-microsoft-com:office:office' xmlns:msdt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'><head> <meta name='progid' content='SharePoint.Link' /><!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix='mso:' FieldList='FileLeafRef,URL'><xml><mso:CustomDocumentProperties><mso:ContentTypeId msdt:dt='string'>0x01010A00848AC699445DE24B86BD19318CE9367F</mso:ContentTypeId><mso:IconOverlay msdt:dt='string'>|com|linkoverlay.gif</mso:IconOverlay><mso:URL msdt:dt='string'>https://www.google.com, this is url google desc</mso:URL></mso:CustomDocumentProperties></xml></SharePoint:CTFieldRefs><![endif]--></head><body><form id='Form1' runat='server'><SharePoint:UrlRedirector id='Redirector1' runat='server' /></form></body></html>"

Replace <mso:URL msdt:dt='string'>https://www.google.com, this is url google desc</mso:URL> with your own values.

BR

Your Answer

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

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