我想使用C#编码将数据导出到MS-word的任何文档中。

问题描述:

我想使用C#编码将文本数据导出到任何文档,例如pdf,Ms-word,Text和驱动器中文件夹中的图像。使用C#编码。



我尝试了什么:



此代码我已经使用但它不适用于word文档....它适用于PDF

I want to export text data into any document like pdf,Ms-word,Text and images in folder on drive from MS-word using C# coding.

What I have tried:

This code i already use but it not work for word document....It work for PDF

using Bytescout.PDFExtractor;
private void button1_Click_1(object sender, EventArgs e)
{
	TextExtractor extractor = new TextExtractor();
	extractor.RegistrationName = "demo";
	extractor.RegistrationKey = "demo";

	
	extractor.LoadDocumentFromFile(@"D:\Importfromword2017.docx");

	// Save extracted text to file
	//extractor.SaveTextToFile(@"D:\output.txt");

	// Open output file in default associated application
	//System.Diagnostics.Process.Start(@"D:\output.txt");
}

这是一个棘手的问题,因为您可能想要导出许多不同类型的数据。



本页右侧的相关问题有许多相关问题。



此外, Google搜索有许多有用的链接: c#将数据导出到单词 [ ^ ]
This is a tricky one as there are many different types of data that you may want to "export".

The Related Questions on the right of this page has a number of related questions.

Also, Google search has a number of helpful links: c# export data to word[^]