Convert Microsoft Word Document to array in C# [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a table (N x M) in Microsoft Word Document (.docs). How can I read this table in C# and enter all values in 2-dim array (N x M)?

You can use third party library or the dedicated Microsoft OpenXML SDK to do this. Here's some documentation about how word tables works using the OpenXML SDK.
Also, as mentionned, docx are packed zip with xml files inside them, you can go the brute way or using COM Interop.

.docx file is a zip archive with some service files insde. You can programmaticaly unpack file, containing your data and read it as standart xml-file.
If you want to use COM, you should:
Create COM object
Open required .docx
Navigate throught doc to table
Read it cell by cell

Related

Validate Excel Data in C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to validate Excel data according to the following before importing into a database:
Some columns have a maximum length
Some columns are numbers/dates
There must be no special characters
How can i go about this? (I am using C#)
EDIT: How do I validate an Excel column to have a maximum text length using Interop, for example, if I do not want the text to be more than 30 characters long? #JMK #artm #Linger #ivan_pozdeev #BenR
Use the Microsoft OpenXML SDK for Office to open the file and examine its contents. Library is available here http://msdn.microsoft.com/en-us/library/office/bb448854(v=office.15).aspx
Open XML SDK will be a great start
try this guide from MSDN - http://msdn.microsoft.com/EN-US/library/office/gg575571(v=office.15).aspx
NOTE - Open XML SDK is free to use and distribute. Go through documentation and first try to understand how Spreadsheets are structured. Also Open XMl SDK support ONLY open XMl file foramts, that means .XLSX as default for exel and NOT .XLS

How read data (text and numers) from DOC,DOCX,XLS,XLSX,RTF,ODT,ODS files [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I can't found solution... How read data (text and numers) from DOC,DOCX,XLS,XLSX,RTF,ODT,ODS files without MS Office Interop (Word,Excel) and OpenOffice SDK library (cli*.dll files) and any paid library???
The problem is the following:
- Need to read data from files coming in the mail and upload them to the database, obviously not knowing the file format.
- Files are not codify and structuring.
Is the way to do this?
By reinventing the wheel and writing code that parses all those formats.
See Microsoft Office File Formats to find out how.
I recommend NPOI which helps you read/write xls, doc, ppt files.
http://npoi.codeplex.com/
Another one I know is excel data reader allows you to read xls and xlsx format. It gives you result in Dataset.
https://exceldatareader.codeplex.com/
Both are free

Generate PDF file without using third party DLL [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Can you please help me in generating PDF file using c# and without using 3rd party dll?
Expect all possible solutions/ideas/suggestions.
Thanks,
Anil
You can create a rdlc file and export it to PDF using the built-in function of ReportViewer.
Using ReportViewer you can also create a report and export it to PDF at runtime (without preview).
Is the pdf fromat a strict requirement? If not, it is a bit easier to create html or rtf documents, if you can't use 3 part libraries.
If it is a requirement, you can create a pdfdocument (example here) and create a text-template (like this one) to replace the data you want.

Trying to make a very outdated Baan system more accessible for the users with C# and Excel via interop [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Upon suggestion this question has been amended to the following;
Does anyone here know about Baan as a system and if so how compatible (if at all) is it with Excel from a developer's point of view? I need to pull reports from Baan to populate Excel workbooks and be able to take certain portions of data into other workbooks without bringing in the whole code and sifting through it.
This is really 3 independent questions:
How do I parse a BaaN report in C#? (You may have some trouble with this, unfortunately.)
How do I read an Excel file in C#?
How do I generate an Excel file in C#?
if you are looking the pull data from data source into excel that is just tabulate format. so what you need to learn is excel inter-op with C# and that is very simple i can provide you some of samples. as like.
http://vscontrols.blogspot.com/2010/09/manipulating-excel-using-adonet.html
and if you are looking to pull complex data and matrix values from the Data Source then i suggest you to read about the EXCEL DNA its an open source having power to play around the Excel widely.

Best Libraries and Plugins for .NET to Write to Word [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
What are the best libraries/plugins for .NET to access Word (create Word files and such)? I have used the Winnovative Excel one so I might check out their Word one, but what are some others?
I have used the free Open SDK 2.0 from Microsoft in the past, primarily to manipulate Office 2010 documents on the server (where installing the Office components is not recommended).
Since the Office 2010 file formats (e.g., XLSX, PPTX, etc.) are simply zip files containing a bunch of XML files, they can easily be manipulated without having to install any Office component.
I've always been partial to Aspose.Words. They have a whole line of components for other document types: PDF, Excel, etc.

Categories

Resources