We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Copy groupshape from one document to another

Hello,

I would like to copy a groupshape from one Document to another and postion it in the new Document. Is that possible an how to do it?

One more point. There is a freeform shape in the group.

Thanks in advance

Holger

@Holger_Schulze You can use Document.ImportNode method to copy nodes between documents. For example see the following code:

// Open document.
Document src = new Document(@"C:\Temp\in.docx");

// Create or open document where group shape should be copied.
Document dst = new Document();

// Get group shape.
Node groupSgape = src.GetChild(NodeType.GroupShape, 0, true);

if (groupSgape != null)
{
    // Copy groupSgape node into the destination document.
    dst.FirstSection.Body.FirstParagraph.AppendChild(dst.ImportNode(groupSgape, true));
}

Thanks Alexey that worked for me.

Kind regards