Saving index of word file in a table.

rowix
rowix Member Posts: 27
Has anybody got some idea's?
How to import all words separately in a table.

I tried this with the following code(Dirty):
StartTime := TIME;
IF NOT ISCLEAR(WoApp) THEN 
  CLEAR(WoApp); 

CREATE(WoApp); 

WoApp.Documents.Open2000(Path,ParamFalse,ParamTrue);
Spaces := WoApp.ActiveDocument.Words.Count;
Spaces -= 1;
Counter := 1;
IF Spaces <> 0 THEN BEGIN
DocMgtIndexTmp.DELETEALL;
  REPEAT
    FoundWord := WoApp.Documents.Open2000(Path,ParamFalse,ParamTrue).Words.Item(Counter).Text;

    DocMgtIndexTmp.INIT;
    DocMgtIndexTmp.INSERT(TRUE);
    DocMgtIndexTmp.Word := FoundWord;
    DocMgtIndexTmp.MODIFY;

    Counter += 1;
  UNTIL Counter = Spaces;
  WoApp.Documents.Close;
  WoApp.Quit;
  EXIT;
END;
WoApp.Documents.Close; 
WoApp.Quit; 

But performance is :cry: (2,6MB Doc with 7000 words 12 minutes) :cry::cry::cry:

Is there anybody that can make me \:D/

Comments

  • kine
    kine Member Posts: 12,562
    What about saving the file into text and import the text file? May be it will be much faster... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.