Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Word Documents using VFP3 and save to memo

Status
Not open for further replies.

sumpun

MIS
Feb 20, 2002
21
HK
HELP !!!!!!

Does anyone know how I can read and extract sections of text from word documents using VFP version 3.0 and then save this into a memo table field of a table.

HOPE SOMEONE CAN HELP ME !!!???

Cheers,

Sum
 
While I believe VFP 3.0 OLE Automation capabilties are more limited (and likely more "buggy") than the current versions of VFP, you should be able to use these techniques to "extract" the data. A good book to get started is "Microsoft Office Automation with Visual FoxPro" by Tamar E. Granor and Della Martin, available at You may also want to run a query at MS Knowledgebase ( Try, Visual FoxPro, howto: word, All - I'm getting a number of articles that may give you a (free) starting point.

Rick
 
The QUE book I have on VFP gives information on using DDE with Word. Here's the code they suggest:
Code:
*.. Shut off Run Aplications Messages
=DDESetoption("SAFETY",.f.)

*.. attempt to establish a conveersation with Word for Windows
ln_channel = DDEInitiate("WINWORD", "System")

*..  If conversation fails attempt to run application
IF ln_channel < 0
        RUN /n1 c:\your path\WINWORD.EXE
        ln_channel = DDEInitiate(&quot;WINWORD&quot;, &quot;System&quot;)
ENDIF

*.. open file
=DDEExecute(ln_channel, '[fileopen &quot;c:\winword\test.doc&quot;]')
ln_chan2 = DDEInitiate(&quot;WINWORD&quot;, &quot;C:\WINWORD\TEST.DOC&quot;)
ln_text = DDERequest(ln_channel, &quot;\doc&quot;)
? ln_text
Trouble is it appears to just pull up word with the document and not put the text in the variable ln_text. I'm not sure what I'm doing wrong, or if things have changed since VFP 3 and whatever Word versions were available then. Anyway it may be someplace to start. Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top