2016-03-08 95 views
-1

如何動態地創建超鏈接docx.dll,低於目前嘗試,但沒有工作用docx.dll創建超鏈接?

using (DocX document = DocX.Create(@"Test.docx")) 
{ 
    // Add a hyperlink to this document. 
    Hyperlink h = document.AddHyperlink 
    ("Google", new Uri("http://www.google.com")); 

    // Add a new Paragraph to this document. 
    Paragraph p = document.InsertParagraph(); 
    p.Append("My favourite search engine is "); 
    p.AppendHyperlink(h); 
    p.Append(", I think it's great."); 

    // Save all changes made to this document. 
    document.Save(); 
} 

回答