Click here to Skip to main content
12,621,744 members (34,112 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# 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 20: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)



Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2016
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