Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing Word Tables
Message
De
21/06/2000 20:03:11
 
 
À
21/06/2000 16:28:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00382885
Message ID:
00382963
Vues:
15
This message has been marked as the solution to the initial question of the thread.
Hi David,

Why would you have to have that intermediate step? While I haven't tried it, I don't see why you couldn't directly import using the Word Tables and Cells collections. Something like......
USE mytable
oWord=CREATEOBJECT("Word.Application")
oWord.Documents.Open("Mydocument.doc")
oDoc=oWord.ActiveDocument
WITH oDoc.Tables(1)
   FOR i = 1 TO .Rows.Count
      INSERT INTO mytable (field1,field2,field2) ;
                   VALUES (.Cell(i,1).Range.Text,;
                           .Cell(i,2).Range.Text,;
                           .Cell(i,3).Range.Text)
   ENDFOR
ENDWITH

ENDWITH
>I can import a word table by first exporting it to an excel worksheet, then importing the worksheet into VFP.
>
>Anyone have an alternate method they prefer?
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform