Xceed Words for .NET v5.0 Documentation
Welcome to Xceed Words for .NET v5.0 / Code Snippets / Hyperlinks
In This Topic
    Hyperlinks
    In This Topic

    The following example demonstrates how to add a Hyperlink in a Document.

    C#
    Copy Code
        private void AddHyperlink( string file )
        {
          using( var document = DocX.Load( file ) )
          {
            // Add a hyperlink to the document's Hyperlink collection
            Hyperlink link = document.AddHyperlink( "website", new Uri( "https://xceed.com" ) );
    
            // Add a paragraph that uses the hyperlink
            document.InsertParagraph( "Visit our " ).AppendHyperlink( link ).Append( " for more information." );
    
            // Save the changes to the document
            document.Save();
          }
        }