Free Support Forum - aspose.com

Import a image as hyperlink in a Word document using Aspose.Words for .NET

It shows the url, but can’t work. Here’s my code:

Shape imageShape = new Shape(doc, ShapeType.Image);
imageShape.ImageData.SetImage(Server.MapPath(“Temp”) + “\icon_doc.gif”);
imageShape.Width = 15;
imageShape.Height = 15;
imageShape.Target = “_blank”;
imageShape.HRef = “http://www.yahoo.com.tw”;
doc.FirstSection.Body.Tables[0].Rows[3].Cells[3].FirstParagraph.AppendChild(imageShape);

Thanks a lot.

Hi

Thanks for inquiry. You should press Ctrl+Click to open link in browser.

Best regards.

I press Ctrl+Click ... It's not work until i Add the code :

imageShape.Inline = true;

Hello Lin.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

It’s nice that you got right with this code. Please let us know what you would like to know or to request further. We’d be happy to help you.

Regards,