CSOM: Set primary set collection admin

When creating modern site collections (e.g. sites with STS#3 Base Template) in SharePoint Online using CSOM the creator of the site will be automatically set as site owner and afterwards becomes site collection administrator afterwards.

To prevent this you have to change to primary site admin, remove old admin user from the site collection admins. This can be done in CSOM using the following logic.
Weiterlesen „CSOM: Set primary set collection admin“

ClickOnce Installation without trust prompt

ClickOnce deployment is an easy way to publish .Net Applications. When you install a ClickOnce application you normally get a trust prompt window where you have to choose if you really want to install the application. This could make things complicated when you want to remote install an application on client machines.
Weiterlesen „ClickOnce Installation without trust prompt“

Office Interop API: Automate printing for Word, Excel, PowerPoint and Outlook

Automate printing by using the office interop apis can cause some trouble if you don’t know which printing functions you can use for the different programs. The problem is that all apis use different functions to change the active printer and print out items.
Weiterlesen „Office Interop API: Automate printing for Word, Excel, PowerPoint and Outlook“

Language recognition with NTextCat

Ivan Akcheurovs NTextCat library for C# contains some very usefull functions for recognizing the language of a string. If the string contains at least 5 words language recognition works very good in most cases.

You can add different dictionaries for specific languages. In my case I needed to analyse strings containing English, German, French, Spanish and Chinese language for setting a SharePoint metadata column.

Weiterlesen „Language recognition with NTextCat“