c# - How to add hyperlinks into Word docx using open XML? -
i having trouble adding hyperlinks word document. don't know how it. make link in word document c# code using open xml. ther different solution using href or sth similar? there hyperlink class on net open xml how use it?
try this
using (wordprocessingdocument doc = wordprocessingdocument.open("", true)) { doc.maindocumentpart.document.body.appendchild( new paragraph( new hyperlink(new run(new text("click here"))) { anchor = "description", doclocation = "location", } ) ); doc.maindocumentpart.document.save(); }
Comments
Post a Comment