How to extract data for a specific cell from a table in MS Word

Source: Internet
Author: User

Recently working on a project that has a technical challenge: "Extract data from a specified cell in the specified table in Word." This is a very, very big challenge for a student like me who just knows a little about C # syntax.

Login to Google, I have retrieved quite a few articles from more than 500 lines of code to less than 100 lines of code. These data extraction methods are basically a few, these people on the blog basically you copy me, I copy you. Now some of the authors are very irresponsible, take a piece of code to put it up. By going through the code, you will find that there are places where the author's custom classes are used, but the author does not provide you with the implementation of these classes. Such an author is very irritating! Some authors, on their own blog, have hundreds of lines of code, plus a title is over. What does the code mean, the program's entire implementation process is what it looks like, said not to say. The code is so much that no one is bothered to see it. A few incisive articles, I cream, after a few weeks of search and screening, and finally sorted out a set of feasible solutions. This article uses a simple example to uncover how to extract the specified cell data from the table in Word.

Preparatory work:

New Word document Doc1.doc. Draw the table and insert the data in the table, as shown in the following table:

Id Name
1 Wulei
2 Jack

Interface design and program running process screen screenshot:

Description: Opens a file by opening a button (displaying the file path in a TextBox control)

Open the file you just created Doc1.doc

Reads the 1th column of data in the second row, which is displayed in the TextBox control.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.