The following answer explains how to do this in VBA by setting the Locked property on the PowerPoint Shape. However, when trying to do this in C# as a VSTO Addon the Locked property is not available.
PowerPoint VSTO - how to lock Shapes (manually you would do this in the Selection Pane)?
165 Views Asked by Neil Kimber At
2
There are 2 best solutions below
1
Neil Kimber
On
Thanks to @Eugene Astafieve. The following line achieves what I wanted to do:
var LockedVar = myGroup.GetType().InvokeMember("Locked", System.Reflection.BindingFlags.SetProperty, null, myGroup, new object[] { OfficeCore.MsoTriState.msoTrue });
Where: myGroup is a PPT Shape (in my case a Grouped Shape)
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in POWERPOINT
- Microsoft Office 365 problem cannot open a blank excel document
- Limit object movement to one axis only in Powerpoint
- How to convert a PPTX file to PDF using Python without depending on Windows (For Linux)
- SSRS report exporting as PPT file
- Difficulty Embedding Fonts in PowerPoint Slides via insertSlidesFromBase64 Method
- When I click "enable macros" on my PowerPoint presentation, I get an error saying controls can't be activated. They're not registered on this computer
- Is there a way of assigning subscripts/superscripts as shown below?
- VB code to set two color gradient in PowerPoint cell table
- How can I copy a date from excel to powerpoint through vba and forcing english format regardless of local formatting?
- Is there a way to have a working drop-down list in a table from a slide in a PowerPoint file that is being displayed in MS Teams?
- Edit Excel Cell with ActiveX
- VBA pasting from Excel to PowerPoint has stopped working
- Link shape size and position to a text table dynamic content
- VBA PowerPoint Run-time error '-2147467259' (80004005): Presentation.Close: Failed
- python pptx not extracting all the text
Related Questions in VSTO
- menu item in plugin for outlook using c# VSTO
- Inline pictures: Add margin
- Storing the state of a VSTO Outlook plugin in a draft message
- Issues with WebView2 in WPF Usercontrol Embeded in Word VSTO CustomTaskPane
- How can I get the full content of a Word Document?
- VSTO Ms-Word addin -i need to show publisher name in Ms-Word addin section. I aready digtaly sign with digicert
- File Not Found Exception for System.Text.Json (VSTO Addin). Upgrade of RestSharp?
- .Net Excel Interop Multiple Columns Delete with range very slow
- Document.AcceptAllRevisions() in Word Interop did not work
- Word Add-In, C# VSTO, Ribbon XML, what's the signature for the built-in "undo" command's handler?
- Is this programming pattern the solution to Excel COM interop memory leaks?
- why VSTO Outlook Add-in and Office JS add-in conversationId is not same?
- No Such Interface supported while copying worksheets from source Workbook to destination Workbook - Excel VSTO Addin
- Is it possible to add docker support to VSTO Add-in?
- Call VSTO Excel Plugin from Macro Button VBA
Related Questions in OFFICE-ADDINS
- office web addin URLs in manifest to local images
- Excel addin authentication for manifest referenced files
- Does the Excel desktop client have a DOM Document, and how do I get to it?
- Why PresentationOpen event is not triggered when opening an existing presentation via an hyperlink in the current presentation?
- Why can't I get a result from the Office.context.mailbox.item.to.getAsync function?
- VB code to set two color gradient in PowerPoint cell table
- Removing SlideMasters using the PowerPoint API
- how to get access token in word document 365 in desktop view
- Develop Add-in from an existing spreadsheet Excel JavaScript API
- Microsoft Excel Add-in Microphone Access
- PowerPoint JS API: connect 2 rectangles
- How can I get the full content of a Word Document?
- "Trusted Add-in Catalogs" in the Trust Center settings of Outlook is missing on my system
- Custom Web Addin is not shown on a ribbon
- Word Office Javascript API - Format first x chars
Related Questions in COMADDIN
- How do I sign an Excel C# COM Addin?
- How to Convert Existing COM and VSTO Add-ins for the New Outlook on Windows
- Toostrip (Menustrip) dropdown items freeze Office UI application
- An exception occuring while creating summary task and task information in Microsoft Project via Add-In using VSTO
- Excel COM add-in not loading in
- Outlook Crashing on Spellcheck when COM Add-In tries reading message
- Windows Installer Setup Project does not accept output from VSTO Excel add-in project due to supposed architecture mismatch
- ms word dispids for events
- Outlook Add-in Development : Mail Information Removed While Reply/Reply-All
- declaring New Microsoft.Office.Interop.Excel.Application outside of Sub makes the VSTO COM addin to freeze during loading
- Moving ClickOnce VSTO To New Server
- Outlook add-in disabled; Impossible to re-enable
- PowerPoint VSTO - how to lock Shapes (manually you would do this in the Selection Pane)?
- Advanced Installer VSTO Add-in Deployment to Entire Machine not working
- VSTO Identify shared vs User mailbox
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The ShapeRange class doesn't expose the
Lockedproperty. If that works in VBA then you may try using the late-binding technology to call hidden or private members. Use the Type.InvokeMember method to make such calls in .net applications.