Share via

How can I make a textbox in Microsoft PowerPoint slide not editable by user using C# code

Anonymous
2024-03-12T15:44:56+00:00

Hey! I have a textbox on my PowerPoint slide. I want to make this textbox not be editable by the user. I do not want to move this to the slide master (I am aware this will work but this causes other problems for our project). So are there any properties I can set or methods available for a textbox / shape that can allow it to be changed to not editable while the user is in slide design view? Perhaps something in .TextFrame.TextRange; or may you have any other solutions on how to do this? Thank you in advance and I really appreciate the guidance.

Microsoft 365 and Office | PowerPoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2024-03-13T14:52:22+00:00

it does not lock Text Edit as standard.

When you set the built in Locked flag the XML looks like this

To lock textEdit you would have to manually edit it

Obviously there is a learning curve to do the edit but you sound pretty knowledgeable.

Sadly there are still ways to edit the text even with the lock set but it is at least more di9fficult

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

5 additional answers

Sort by: Most helpful
  1. John Korchok 232.7K Reputation points Volunteer Moderator
    2024-03-12T19:01:25+00:00

    It's possible to lock graphics and text boxes by editing the XML of the slide. Here is Microsoft's page with C# code. And here's my how-to article on how it's done manually: OOXML Hacking: Locking Graphics

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-03-13T17:42:39+00:00

    Understood, this works!! Thank you!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-03-13T13:47:35+00:00

    Hi Steve, unfortunately the locked property still allows the user to edit the text. It just prevents the user from moving the shape around.

    Was this answer helpful?

    0 comments No comments
  4. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2024-03-13T03:01:13+00:00

    This won't work in the non-subscription versions of Office, as I recall, but if you have Office 365, shapes in PowerPoint have a .Locked property. Set that to true and the shape will be unselectable.

    Was this answer helpful?

    0 comments No comments