Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Read a Word Document Using C#

Word.Application word = new Word.Application();
       Word.Document doc = new Word.Document();
       object fileName = @"C:wordFile.docx";
        // Define an object to pass to the API for missing parameters
        object missing = System.Type.Missing;                
        doc = word.Documents.Open(ref fileName,
                ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing);
        string ReadValue = string.Empty;
            // Activate the document
        doc.Activate();

         foreach (Word.Range tmpRange in doc.StoryRanges)
         {
            ReadValue += tmpRange.Text;
         }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# delete files in directory and subdirectories 
Csharp :: c# string to int 
Csharp :: access object property C# 
Csharp :: comments in c# 
Csharp :: how to destroy parent gameobject unity 
Csharp :: how to make a string in c# 
Csharp :: how to get a length of a string in c# 
Csharp :: pyautopgui erros 
Csharp :: array reduce c# 
Csharp :: csharp get decimal part of number 
Csharp :: What is the yield keyword used for in C#? 
Csharp :: Sort ListBox numerically in C# 
Csharp :: unity game object remove parent 
Csharp :: linq from multiple tables 
Csharp :: how to store some variables on the device in unity 
Csharp :: primitive types c# 
Csharp :: c# loop through repeater items 
Csharp :: to list c# 
Csharp :: unity public static variable 
Csharp :: list sum c# 
Csharp :: reverse linked list 
Csharp :: Commenting on C# 
Csharp :: System.Data.Entity.Core.EntityException: The underlying provider failed on Open 
Csharp :: concat arrays .net 
Csharp :: change size of button c# 
Csharp :: c# create log file 
Csharp :: jagged array to 2d array c# 
Csharp :: Get unique id of Device 
Csharp :: substring in c# 
Csharp :: unique field in class model .net core 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =