Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

table parser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
carlos - 29 Aug 2005 11:48 GMT
I have a table in a Word document.
I wanna write a parser in java to get the data in each field of the table.
But I found that it is difficult.
So I wonder if there is a way in vba to do this.

My intention is to get the data and write them in a xml file.
If it is difficult, writing to a text file is also acceptable.

Anyone have exp in this? Thanks.
Doug Robbins - 29 Aug 2005 16:38 GMT
Dim myrange As Range, i As Long, j As Long, mytable As Table
Set mytable = ActiveDocument.Tables(1)
For i = 1 To mytable.Rows.Count
   For j = 1 To mytable.Columns.Count
       Set myrange = mytable.Cell(i, j).Range
       myrange.End = myrange.End - 1
       'do what you want to with myrange which will now contain
       'the contents of the cell.
   Next j
Next i

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a table in a Word document.
> I wanna write a parser in java to get the data in each field of the table.
[quoted text clipped - 5 lines]
>
> Anyone have exp in this? Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.