Hi
Try to use
the following code.
// if the destination document does
not contain PictureBullets then copy it from sourse document
if (doc.Range.Bookmarks["_PictureBullets"]
== null)
{
NodeCollection bookmarks = docRef.GetChildNodes(NodeType.BookmarkStart, true);
foreach (BookmarkStart
start in bookmarks)
{
if (start.Name == "_PictureBullets")
{
Node bookmarkNode = start;
DocumentBuilder builder = new
DocumentBuilder(doc);
builder.MoveToDocumentEnd();
while (bookmarkNode.NodeType != NodeType.BookmarkEnd)
{
builder.InsertNode(importer.ImportNode(bookmarkNode,
true));
bookmarkNode = bookmarkNode.NextSibling;
}
builder.InsertNode(importer.ImportNode(bookmarkNode, true));
}
}
}
//else copy only pictures.
else
{
NodeCollection bookmarks = doc.GetChildNodes(NodeType.BookmarkStart, true);
foreach (BookmarkStart
start in bookmarks)
{
if (start.Name == "_PictureBullets")
{
Node bookmarkNode = start.NextSibling;
DocumentBuilder builder = new
DocumentBuilder(doc);
builder.MoveToBookmark("_PictureBullets",
true, true);
while (bookmarkNode.NodeType != NodeType.BookmarkEnd)
{
if (bookmarkNode.NodeType == NodeType.Shape)
{
builder.InsertNode(importer.ImportNode(bookmarkNode, true));
bookmarkNode = bookmarkNode.NextSibling;
}
}
}
}
}
I hope that
it will help you.
Best regards.