>I have a database with some artikeldetails. For each line i want to create a table in word with the details. I cannot make a table with reccount-rows because sometimes i have to add a picture of the article just before or just after the table. Everything works fine exept for one thing. When to tables directly follow each other there is a blank space between them what causes an empty line. How can I delete this empty line. Here's a part of the code:
>
>go top in "artiktmpl"
>do while !eof("artiktmpl")
>
> **** Insert a before picture if wanted ****
>
> oTable = oDocument.tables.add( oRange, 1, aanttab, wdWord9TableBehavior,2)
> oTable.borders.InsideLineStyle = .F.
> oTable.borders.OutsideLineStyle = .F.
>
> **** Add values to the different cells *****
>
> oRange.move(6) && To jump out of the table
>
> **** Insert a after picture if wanted ****
>
> oRange.move(6)
> oRange.InsertAfter(CR)
> oRange.move(6)
>
> skip in "artiktmpl"
>enddo
Guillaume,
You could surround the 'after table' picture + CR insertion with if :
oRange.move(6)
if llInsertPic
oRange.move(6)
oRange.InsertAfter(CR)
oRange.move(6)
endif
Also I wonder if this executes fast? Instead of setting cell values one by one, you could insert a tab, comma etc delimited text there and TextToTable().
Cetin