简体   繁体   中英

How to hide a text inside a Powerpoint slide using OpenXML SDK?

I'm trying to hide a text inside a slide (or TextBox) by using OpenXML SDK. How Do I hide the text without the user seeing it?

I tried to set the opacity using Drawing.Run method but it doesn't support the HexCode having length greater than 6. The powerpoint shows the warning message to Repair the presentation after that.

The code I've tried is :

 Drawing.RgbColorModelHex rgbColorModelHex2 = new Drawing.RgbColorModelHex() { Val = "00FFFFFF" };

On my research there is a vanish property in DocumentFormat.OpenXml.Wordprocessing for hiding text on Word but couldn't find vanish on powerpoint. Is there any similar property in powerpoint ? or else how do I hide a text ?

Thanks in advance

The Open XML Productivity Tool is included with the SDK. Make a pair of files in PowerPoint, one with the text showing and the other with the text hidden (use the Selection Pane to do this). Then use the Compare Files feature in the Productivity tool. The initial view will show the XML parts that have differences. Then click on the View Package Code to see automatically generated C# code that will help you figure out the correct syntax.

Another toolset that is very helpful with Open XML is Open XML Power Tools. Here's the NuGet page for it: OpenXmlPowerTools 4.5.3.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM