Hoe om Group Shape By'n Word-Dokument Te Voeg

Contents
[ ]

Soms moet jy’n group shape by’n Word-dokument voeg. So’n group shape bestaan uit verskeie vorms.

In Microsoft Word kan jy vinnig’n group shape byvoeg deur die Groepopdrag/knoppie te gebruik. ‘n individuele vorm in’n groep kan afsonderlik verskuif word.

In Aspose.Words is dit baie maklik om’n group shape by te voeg met behulp van die GroupShape klas. Shape word afsonderlik geskep met behulp van die Shape klas en dan by die GroupShape voorwerp gevoeg met behulp van die AppendChild metode.

Die volgende kode voorbeeld toon hoe om’n group shape in’n Word dokument te voeg:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WorkingWithDocument();
Document doc = new Document();
doc.EnsureMinimum();
GroupShape gs = new GroupShape(doc);
Shape shape = new Shape(doc, Drawing.ShapeType.AccentBorderCallout1);
shape.Width = 100;
shape.Height = 100;
gs.AppendChild(shape);
Shape shape1 = new Shape(doc, Drawing.ShapeType.ActionButtonBeginning);
shape1.Left = 100;
shape1.Width = 100;
shape1.Height = 200;
gs.AppendChild(shape1);
gs.Width = 200;
gs.Height = 200;
gs.CoordSize = new System.Drawing.Size(200, 200);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertNode(gs);
dataDir = dataDir + "groupshape-doc_out.doc";
// Save the document to disk.
doc.Save(dataDir);