Cannot insert node of this type at this location error

Hi,
I m trying an existing table copy in a document with InsertNode but i get an exception ‘Cannot insert node of this type at this location error’ at runtime. Could you please look at the code below and tell me what I’m doing wrong?
Thanks…

private void SetSameBookmarkContents(string bookmarkName, Node node)
{
    if (node == null) return;
    string strBookmarkName = this.GetBookmarkName(bookmarkName);
    while (strBookmarkName != bookmarkName)
    {
        if (this.MoveToBookmark(strBookmarkName)) this.InsertNode(node.Clone(true)); // I get exception at this line, also i tryed this.InsertNode(node) but result did no changed; .
        strBookmarkName = this.GetBookmarkName(bookmarkName);
    }
}

Hi
Thanks for your inquiry. Using InsertNode method you can insert text level nodes only (Run, Shape). I think you should use InsertBefore or InsertAfter method. For example see the following code:

builder.CurrentParagraph.ParentNode.InsertAfter(myTable, builder.CurrentParagraph);

Also see the following link.
https://reference.aspose.com/words/net/aspose.words/compositenode/insertafter/
Hope this helps.
Best regards.

Thank you for interest and reply. It’s ok.
Good working…