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

Free Support Forum - aspose.com

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
I used Aspose.Word 17.8.
My sample is hyperlink.zip (49.4 KB)
Thanks you in advance

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)


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 = "";

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