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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -