working with tables

R

Ralf

Hello,

i need a starting point.
I'm trying to get text out of the cells of a table.
out of these texts i'm going to create xml files.

any ideas?

thx a lot
Ralf
 
J

Jonathan West

Ralf said:
Hello,

i need a starting point.
I'm trying to get text out of the cells of a table.
out of these texts i'm going to create xml files.

any ideas?

thx a lot
Ralf

Dim x() As String
Dim iRows as Long
Dim iColumns as Long
Dim iRow As Long
Dim iColumn as Long

With ActiveDocument.Tables(1)
iRows = .Rows.Count
iColumns = .Columns.Count
ReDim x(1 To iRows, 1 to iColumns)
For iRow = 1 to iRows
For iColumn = 1 to iColumns
x(iRow, iColumn) = .Cell(iRow, iColumn).Range.Text
x(iRow, iColumn) = Left$(x(iRow, iColumn), Len(x(iRow,
iColumn)) - 2)
Next iColumn
Next iRow
End With

You now have an array containing the text of the cells of the first table of
the active document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top