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

Free Support Forum - aspose.com

How to set image title property in word with alt text property of Image tag using C#

Hi Team,

While exporting HTML to Word, alt property of the image tag is directly mapped to description property of the image in word. What property we need to set in html which can be mapped to title property of the image in word?



You can use Shape.Title property to set the title (caption) of the shape object. Please check the following code example. Hope this helps you.

Document doc = new Document(MyDir + "input.html");
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
shape.Title = shape.AlternativeText;
doc.Save(MyDir + "output.docx");