Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting information _out_ of word
Message
From
04/06/2001 13:17:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00514657
Message ID:
00514692
Views:
8
>Help!! Can anyone tell me how to read information from a table in a word
>document? I know how to put the info in, but when I try to reverse
>the process by assiging the text value to a variable, it bombs.
>
>Here's my code:Public cAddress
>
>
>
>IF NOT USED('BLOCGRAN')
> USE BLOCGRAN IN 0 EXCLU
>ENDIF
>oWord = createobject("word.application")
>oDocument = oWord.Documents.Open("h:\kavitha\shap_help_rah_97_99.doc")
>oRange = oWord.ActiveDocument.tables[1].Range
>oRange = oWord.ActiveDocument.Range()
>oRange = oWord.ActiveDocument.Content
>cAddress=oWord.ActiveDocument.Tables[1].Rows[1].cells[1].text
with oWord
 .Documents.Open(lcDoc)
 with .ActiveDocument.Tables(1)
   for iRow=1 to .Rows.Count
	for iCol=1 to .Columns.count
	  ? .Rows(iRow).Cells(iCol).Range.Text
	endfor
   endfor
 endwith
 .Quit
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform