Click here to Skip to main content
11,644,731 members (60,759 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
i am reading a ms word document using c#. it reads all characters including tab,white space,empty string,special characters, numbers. i want only and exactly the words. can anyone provide me an optimal solution. answers with coding will be more helpful. thanks in advance..
Posted 11-Oct-12 19:32pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use Words member[^] of Document[^] object.

Note:
Each item in the Words collection is a Range object that represents one word. There is no Word object.


Steps to do:
1) Create an instance of MS Word.
2) Open existing document.
3) Go through the collection of Words (use for each loop).
4) Close the document.
5) Close an instance of MS Word.

That's all!

Word tasks[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

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

  Print Answers RSS
0 OriginalGriff 680
1 jyo.net 494
2 Sergey Alexandrovich Kryukov 454
3 Afzaal Ahmad Zeeshan 404
4 CPallini 386
0 OriginalGriff 1,020
1 Sergey Alexandrovich Kryukov 673
2 DamithSL 656
3 Afzaal Ahmad Zeeshan 652
4 CPallini 555


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100