Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing Word Tables
Message
From
21/06/2000 20:03:11
 
 
To
21/06/2000 16:28:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00382885
Message ID:
00382963
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform