0

I want to do the next, but don't know how to do it, please help me.

First, I open the Word document by

wordApp.Documents.Open; 

then I try to save it by another name to make a copy using

aDoc.SaveAs(ref saveas...);

Now I want to go through the savedAs document word by word. I need to get every word and go through the word letter by letter.

So, actually I want to get the word, check it for some rules, then get read that word letter by letter and make changes (transliterate) to those letters, so in the end I will have the transliterated document. I was trying to write this code using for loop insdie for loop, but I don't know how can I loop the whole document word by word... and at the same time rewrite the new form of word instead of the currently taken word.

Please, help me with right Interop.Word commands to implement this.

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
Hurrem
  • 193
  • 2
  • 4
  • 15
  • What have you tried? I only see Document.Open; (which is an incorrect statement) and the function SaveAs – RvdK Feb 21 '13 at 16:35
  • [This](http://stackoverflow.com/questions/13120184/how-to-create-excel-in-my-c-sharp-application-if-msoffice-is-not-installed/13120402#13120402) can help you. – Hamlet Hakobyan Feb 21 '13 at 16:37
  • 1
    Google found this for me: http://stackoverflow.com/questions/6924056/is-there-a-way-to-read-a-word-document-line-by-line – Ralf de Kleine Feb 21 '13 at 16:37
  • top result on google... http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5b82c0b5-ecaf-40f2-a68a-c7c17c85414f – Fredrik Feb 21 '13 at 16:37

1 Answers1

0

This article explains how to retrieve words from a word doc

http://zirmandli.wordpress.com/2007/07/04/read-word-doc-using-c/

Document is retrieved by calling this :

Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj,
                                      ref nullobj, ref nullobj, ref nullobj,
                                      ref nullobj, ref nullobj, ref nullobj,
                                      ref nullobj, ref nullobj, ref nullobj);
nothingInTheName
  • 313
  • 4
  • 11