Lucrul cu Group Shape în documente Word

Contents
[ ]

Uneori trebuie să adăugați un group shape într-un document Word. Un astfel de group shape este format din mai multe forme.

În Microsoft Word, puteți adăuga rapid un group shape Folosind comanda/butonul de grup. O formă individuală dintr-un grup poate fi mutată separat.

În Aspose.Words este foarte ușor să adăugați un group shape folosind GroupShape clasă. Forma este creată separat folosind clasa Shape și apoi adăugată în obiectul GroupShape folosind metoda append_child.

Următorul exemplu de cod arată cum să adăugați un group shape într-un document Word:

# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET
doc = aw.Document()
doc.ensure_minimum()
groupShape = aw.drawing.GroupShape(doc)
accentBorderShape = aw.drawing.Shape(doc, aw.drawing.ShapeType.ACCENT_BORDER_CALLOUT1)
accentBorderShape.width = 100
accentBorderShape.height = 100
groupShape.append_child(accentBorderShape)
actionButtonShape = aw.drawing.Shape(doc, aw.drawing.ShapeType.ACTION_BUTTON_BEGINNING)
actionButtonShape.left = 100
actionButtonShape.width = 100
actionButtonShape.height = 200
groupShape.append_child(actionButtonShape)
groupShape.width = 200
groupShape.height = 200
groupShape.coord_size = drawing.Size(200, 200)
builder = aw.DocumentBuilder(doc)
builder.insert_node(groupShape)
doc.save(docs_base.artifacts_dir + "WorkingWithShapes.add_group_shape.docx")