Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a task to get the data from a word . In the word, here are these questions, like id, name, age,sex, school, class , major ,eg.
I need to get these information, and store them in the database.
My office version is 2007.
How can i get these data from a word doc with c#,
or how to operate the Active X controls those are in a word doc with C# ?
Can i use aspose.word to read data ?
Any ways to get these data with C# is OK
Thank you
just like this situation: here is a checkbox in a word. I want to know if it was checked,
a textbox control ,I want to konw the text.
Posted
Updated 7-Mar-14 22:06pm
v3
Comments
ZurdoDev 7-Mar-14 12:10pm    
You could always write a macro to do it. In fact, you can record the macro and see most of the code.

First of all, Word document is not a database! Even if there are some useful information, like Name, age, sex, etc. there is no way to read them, unless they are stored in: bookmarks, fields, tables, custom properties.

How to: Read from and Write to Document Properties[^]
How to: Programmatically Update Bookmark Text[^]
Automating Word Tables for Data Insertion and Extraction[^]
Field.Data Property [^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Mar-14 14:39pm    
Voted 4. Can be useful, but... I thing OP knew that it's not a database. Nobody mentioned any tables. Probably the document just have some fixed structure; and the code can extract some data on ad-hoc basis. Of course, it does not look like healthy "architecture"... Main problem is reading/parsing Office document, and there are different approaches, Interop and automation probably being not the best ones...
—SA
Maciej Los 7-Mar-14 14:52pm    
Thank you, Sergey ;)
july2008 8-Mar-14 4:00am    
I konw it is not a db, more i want to know is if the data was strored in: bookmarks, fields, tables, custom properties. Then how to get it?
Maciej Los 8-Mar-14 9:33am    
Follow the links... ;)
Please see my past answer: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

Please don't pay attention for the topic of the original question, read my other answers references in this one.

—SA
 
Share this answer
 
v3
Comments
Maciej Los 7-Mar-14 12:55pm    
+5!
Sergey Alexandrovich Kryukov 7-Mar-14 13:05pm    
Thank you, Maciej.
—SA
Maciej Los 7-Mar-14 13:09pm    
You're welcome. I added my answer. Please, see it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900