convert word files to plain text c#
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Word;
namespace ReadWordDocProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string testFile = @"C:\Users\<mycomputer>\Documents\TestItemHelpers\TestWordDoc.docx";
Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application();
Document document = application.Documents.Open(testFile);//path here
int count = document.Words.Count;
for (int i = 1; i <= count; i++)
{
string text = document.Words[i].Text;
//Do output with text here
richTextBox1.AppendText(text);
}
((_Application)application).Quit(); //cast as _Application because there's ambiguity
}
}
}
Also in C#:
- Title
- multidimensional meaning
- Category
- C#
- Title
- .net 4.5 use tls 1.2
- Category
- C#
- Title
- c# cheat sheet
- Category
- C#
- Title
- ping with c#
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- unity how to load up a scene
- Category
- C#
- Title
- c# if statement
- Category
- C#
- Title
- c# how to sort a list
- Category
- C#
- Title
- what function is called just before the a script is ended c#
- Category
- C#
- Title
- c# enum default
- Category
- C#
- Title
- c# string remove special characters
- Category
- C#
- Title
- how to pause physics in unity c#
- Category
- C#
- Title
- page refresh on button click in c#
- Category
- C#
- Title
- winforms c# add data to datagridview with a button
- Category
- C#
- Title
- how to create more accurate searching c#
- Category
- C#
- Title
- socket in c#
- Category
- C#
- Title
- c# string array
- Category
- C#
- Title
- add new page to site c# programmatically
- Category
- C#
- Title
- visual c#
- Category
- C#
- Title
- how to check if an integer is in array c#
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- how to create public variable in c#
- Category
- C#
- Title
- making a list of chars in c#
- Category
- C#
- Title
- c# how to run external program
- Category
- C#
- Title
- Execute code every x seconds with Update()
- Category
- C#
- Title
- C# for
- Category
- C#
- Title
- dont destroy on load unity
- Category
- C#
- Title
- c# exit program
- Category
- C#
- Title
- unity timer with miliseconds
- Category
- C#
- Title
- c# two dimensional array
- Category
- C#
- Title
- c# clear list items
- Category
- C#
- Title
- check version of asp.net core
- Category
- C#
- Title
- unity up arrow input
- Category
- C#
- Title
- covert char[] to string C#
- Category
- C#
- Title
- unity persistent data
- Category
- C#
- Title
- center an image horizontally and vertically
- Category
- C#
- Title
- c# list string return concatenate
- Category
- C#
- Title
- how to parse a string to an integer c#
- Category
- C#
- Title
- how to close a form c#
- Category
- C#
- Title
- modal dismiss
- Category
- C#
- Title
- c# bool list count true
- Category
- C#
- Title
- c# round to closest multiple
- Category
- C#
- Title
- read configuration workerservice
- Category
- C#
- Title
- roulette algorithm genetic algorithm
- Category
- C#
- Title
- example HttpClient c# Post
- Category
- C#
- Title
- c# filesystemwatcher double events
- Category
- C#
- Title
- c# write variable in string
- Category
- C#
- Title
- c# escape characters
- Category
- C#
- Title
- unity3d raycast
- Category
- C#
- Title
- font family behind code uwp c#
- Category
- C#
- Title
- asp.net mvc return file
- Category
- C#
- Title
- unity docs player input
- Category
- C#
- Title
- replace all ponctuation characters c#
- Category
- C#
- Title
- c# shorten an definition
- Category
- C#
- Title
- console application in c# ms crm
- Category
- C#
- Title
- C# .NET Core linq Distinct
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds
- Category
- C#
- Title
- c# ^ operator
- Category
- C#
- Title
- c# get country code
- Category
- C#
- Title
- download and run exe c# 1 button
- Category
- C#
- Title
- c# region tag
- Category
- C#
- Title
- c# loop string array
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- c# expression func automatically select return type
- Category
- C#
- Title
- c# loop through object
- Category
- C#
- Title
- unity 2d platformer movement script c#
- Category
- C#
- Title
- Microsoft.AspNetCore.Components.Forms.InputSelect`1.TryParseValueFromString(String value, TValue& result, String& validationErrorMessage)
- Category
- C#
- Title
- unity position ui element
- Category
- C#
- Title
- c# creating exceptions
- Category
- C#
- Title
- unity vector3 smoothdamp not reaching target
- Category
- C#
- Title
- c# Sleep
- Category
- C#
- Title
- c# check if type implements interface
- Category
- C#
- Title
- c# arraylist to listview
- Category
- C#
- Title
- unity image
- Category
- C#
- Title
- how to clear console in c#
- Category
- C#
- Title
- using mediamanager how to play mp3 files
- Category
- C#
- Title
- The type or namespace name 'Scrollbar' could not be found
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- how to add system.messaging c#
- Category
- C#
- Title
- unity indestructible
- Category
- C#
- Title
- how to use more than one condition in ef join
- Category
- C#
- Title
- isInstanceOf nunit
- Category
- C#
- Title
- radians to degree c#
- Category
- C#
- Title
- what data type should be for contact number in asp.net
- Category
- C#
- Title
- c# read excel file
- Category
- C#
- Title
- non null array length
- Category
- C#
- Title
- c# param exception
- Category
- C#
- Title
- how to make a pause feautre in unity
- Category
- C#
- Title
- asp list box
- Category
- C#
- Title
- C# enum
- Category
- C#
- Title
- c# dictionary literal initializer
- Category
- C#
- Title
- nullable unique constraint ef
- Category
- C#
- Title
- unity next scene
- Category
- C#
- Title
- ASP select box all states
- Category
- C#
- Title
- unity cast int to float
- Category
- C#
- Title
- how to spawn coins randomly around the screen unity 2d
- Category
- C#
- Title
- c# find element by condition
- Category
- C#
- Title
- C# graph api upload file one drive
- Category
- C#