Unable remove link in image

Hi Aspose, I attached my sample which has hyperlink when clicking picture. I cannot remove this link by using the following code based on Link Remove - #2 by alexey.noskov
I used Aspose.Word 17.8.
My sample is hyperlink.zip (49.4 KB)
Thanks you in advance

Blockquote
string inputDocFile = “D:\testfile.doc”
Aspose.Words.Document doc = new Aspose.Words.Document(inputDocFile);
NodeCollection starts = doc.GetChildNodes(NodeType.FieldStart, true);
foreach (FieldStart start in starts) // No FieldStart here
{
if (start.FieldType == FieldType.FieldHyperlink)
{
start.Remove();
}
}

@truongminhlong

Thanks for your inquiry. To remove picture hyperlink, you need to set Shape.HRef value to empty. Please check following sample code snippet for your reference.

Document doc = new Document(@"hyperlink.doc");
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
shape.HRef = "";
doc.Save(@"Out_AW178.doc");

Hi @tilal.ahmad
Your code works fine.
Thanks you for your reply.