Posts

Open office documents from SharePoint to Client Apps

If you want to open any office document in client side app pragmatically then here is the solution : <script type="text/javascript" language="javascript"> window.location.href = " ms-excel:ofe|u| https://mytenant.sharepoint.com/MyLib/MyExcel.xlsx"; </script> You can use MS Office apps URL scheme names to open any office document in client app from SharePoint. List of MS Office apps URL scheme names: ms-word: ms-powerpoint: ms-excel: ms-visio: ms-access: ms-project: ms-publisher: ms-spd: ms-infopath: To know more about URL scheme, Click Here .

Relink InfoPath Forms in SharePoint Online

After migrating InfoPath form from SharePoint 2010 to SharePoint online, I saw that form templates links were showing old SharePoint 2010 server URL. Now I have relinked it. To relink, Go to Library Settings Under “Permissions and Management” group, click on “Relink documents to this Library”. This will take you to the “Repair.aspx” view. Now go to “Files” Under Actions group, you will find “Relink” AND “Relink All” button. Just hit Relink All to link with current site.

Bulk change JavaScript Extensions (.js) to TypeScript Extension (.ts) recursively

I was working on an upgrade project which required to convert JavaScript/ jQuery to TypeScript files from all the folders & sub folders. Here is the command to rename all .js files to .ts files : for /R %x in (*.js) do ren "%x" *.ts

Delete node_modules folder on Windows machine recursively

This command will find & delete the node_modules folder from the current directory for /d /r . %d in (node_modules) do @if exist "%d" rd /s/q "%d"

SharePoint Framework client-side web part sample with Angular Elements

Image
Greeting Web Part This web part is created with Angular Element. It has one element “ issharepoint ” which takes true if user is running this web part in SharePoint environment. Basically it shows current User Name, Title, Picture Url from “sp.profiles.myProperties” & Web Title from web object. Here is the custom element created : <app-greeting-wp-web-part issharepoint= ${ true } ></app-greeting-wp-web-part> Just download code from GitHub and install dependencies. I am using PnP JS to get data from SharePoint. I don’t want to run npm install every time when I am making any changes. So I made a small change in the project by adding a new file called “copyfile.js”. This file copies the “bundle.js” file to SPFx @node_modules folder. So you have to make changes in the destination path in the file. Thanks to Stefan Bauer for @pnp/spfx  and  Andrew Connell for blog