2016-03-08 2 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(); 
} 

ответ

0

Как насчет использования p.AppendHyperlink("www.google.com", "Google", HyperlinkType.WebLink); ?
Кроме того, вы можете получить ссылку от Insert Hyperlink to Word in C#.