This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Insert pictures in table cell

description

I use DocX version v1.0.0.22 for insert pictures in the table cell. It works only if I insert one or two pictures. When insert more then 2 pictures, word become unreadable.
  tArr = Split(tImages, ",")
  Dim tbl As Novacode.Table = docDestTables

  For iArr = 0 To tArr.Length - 1
    Dim p As Novacode.Paragraph = tbl.Rows(iRow - 1).Cells(iCol - 1).InsertParagraph("", False)
    Dim image As Novacode.Image = tDocDest.AddImage(FileDir & "\" & tArr(iArr).trim & ".tif")
    Dim picture As Picture = image.CreatePicture()
    picture.SetPictureShape(BasicShapes.cube)
    picture.Name = "pic_" & tArr(iArr).trim
    Dim iKor As Double = picture.Height / picture.Width
    picture.Width = Int(50)
    picture.Height = Int(50 * iKor)
    p.InsertPicture(picture)
  Next
What I'm doing wrong?

comments