Get Microsoft Word Hyperlinks with NET REST API

This article guides how to get Microsoft Word hyperlinks with NET REST API. You will learn to automatically get hyperlink in Word document with C# REST API using the .NET cloud SDK. You will learn to fetch the desired information from the API response.

Prerequisite

  1. Create the Configuration object by providing the ClientId and ClientSecret
  2. Create an object of the WordsApi class using the custom configuration
  3. Read the source Word file into a byte array for extracting hyperlinks
  4. Create an object of the GetDocumentHyperlinksOnlineRequest by providing the loaded Word file
  5. Invoke the GetDocumentHyperlinksOnline() method to fetch the list of hyperlinks in the file
  6. Display the resultant hyperlinks list from the API response

These steps describe how to use hyperlink in Word with C# Low Code API. Create the WordsApi object, read the source Word file, and create the request object using the GetDocumentHyperlinksOnlineRequest class. Finally, call the GetDocumentHyperlinksOnline() method to fetch all the hyperlinks and display them on the console.

This code demonstrates how to get Microsoft Word hyperlinks. The response object contains the Hyperlinks object which contains the link and list of hyperlinks. Each hyperlink contains the display text, link, and value containing the actual URL.

This article has taught us to fetch the hyperlink in MS Word. If you are interested in searching for some text in a World file, refer to the following article: Search documents for text with NET REST API.

 English