How to i programmatically change/set the sensitivity label of a excel document using C#.

Nikhil Nair 6 Reputation points
2023-06-22T08:00:48.89+00:00

I have a shared location where I have a couple of Excel files. Now, I need to change the sensitivity label of those Excel files to 'external' along with the corresponding label ID. How can I achieve this in C#? Also, please advise me on whether I can set the sensitivity label while creating an Excel document from a byte array.

Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 25,296 Reputation points
    2023-06-22T09:00:48.98+00:00

    @Nikhil Nair ,

    Please refer to the following Microsoft Learning to programmatically change/set the sensitivity label of a excel document using C#.

    Quickstart: Set and get a sensitivity label (C#)

    As for the question set the sensitivity label while creating an Excel document from a byte array, it seems that it is currently not supported by using above method.

    Best Regards,

    Jack

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.