Share via

PowerPoint VBA Lock

Anonymous
2022-05-14T05:22:29+00:00

Hi.

Is there a VBA function to utilise the new 'Lock' facility in Powerpoint version 2204?

Many thanks,

John

Microsoft 365 and Office | PowerPoint | For home | 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

Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
2022-05-14T16:30:39+00:00

John,

Hey, thanks for asking this. I didn't realize that this had been added but YES.

At least it's in the current Insider version:

Here's a simple example that works here. It simply locks any shapes on slide 1 that are currently not locked and vice versa:

Sub ToggleLock() 

    Dim osh As Shape 

    For Each osh In ActivePresentation.Slides(1).Shapes 

        With osh 

            osh.Locked = Not osh.Locked 

        End With 

    Next 

End Sub

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-05-14T16:53:46+00:00

    Hi Steve.

    I was a little bit early, having tried the code, it locks the aspect ration but does not seem to 'lock' the object.

    John

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-05-14T16:46:53+00:00

    Great.

    Thank you Steve for the swift response.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-05-14T07:20:20+00:00

    Hi.

    Thanks for the welcome.

    I have added a screenshot. It is a new function in the latest release.

    Hope that helps.

    John

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2022-05-14T07:03:13+00:00

    Hello , JohnBanks1

    Welcome to Microsoft Community and appreciate your time taken for sharing detailed information.

    May I ask what exactly you mean by "lock"? Is it like what this post **** said or something else? Can you describe in detail?

    Feel free to post back if you have any additional questions.

    Best Regard,

    Yuhao Li| Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments