Modify Word Group Shapes
Created
June 16, 2025 07:04
-
-
Save openize-com-gists/cac539056f1de6c3bab3b800e11e9bcb to your computer and use it in GitHub Desktop.
Modify Word Group Shapes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace OpenizeGroupShapesModificationExample | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Prerequisite: Install Openize.Words NuGet package | |
| // Install-Package Openize.Words | |
| // Load the Word Document | |
| var doc = new Openize.Words.Document($"WordGroupShapes.docx"); | |
| // Initialize the body with the loaded document. | |
| var body = new Openize.Words.Body(doc); | |
| // Load all group shapes | |
| var groupShapes = body.GroupShapes; | |
| // Traverse through each shape, change the shape type to hexagone and update document. | |
| foreach (var groupShape in groupShapes) | |
| { | |
| groupShape.Shape1.Type = Openize.Words.IElements.ShapeType.Hexagone; | |
| groupShape.Shape2.Type = Openize.Words.IElements.ShapeType.Hexagone; | |
| doc.Update(groupShape); | |
| } | |
| // Save the modified Word Document | |
| doc.Save($"ModifiedWordGroupShapes.docx"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment