I used http://support.microsoft.com/kb/316383/en-us as the basis of
some code to generate a Word document using VB code (.NET2005).
In the code I have a loop which produces a table and in the merged
left hand column I place a picture (looping round a directory full
of ,jpg files - a table entry in the Word document for every picture).
All works fine and the document looks fine on the screen and in Print
Preview, but when I print only about 1 in 6 of the pictures appear on
the paper (always the same ones when reprinted). The other tables have
a blank left hand column.
This is the code which creates the table:
Dim oTable As Microsoft.Office.Interop.Word.Table
RPath = RDirectory & RFileName
oTable
=oDoc.Tables.Add(oDoc.Bookmarks.Item("\endofdoc"). Range, 4, 3)
oTable.Cell(1, 2).Range.Text = "File"
oTable.Cell(1, 3).Range.Text =
RPath.Substring(InStrRev(RPath, "\"))
oTable.Cell(2, 2).Range.Text = "Date"
oTable.Cell(3, 2).Range.Text = "Location"
oTable.Cell(4, 2).Range.Text = "Notes"
oTable.Columns.Item(1).Width =
oWord.InchesToPoints(2.5)
'Change width of columns 1 & 2
oTable.Columns.Item(2).Width =
oWord.InchesToPoints(0.75)
oTable.Columns.Item(3).Width =
oWord.InchesToPoints(2.5)
oTable.Columns.Item(1).Cells.Merge()
With
oTable.Cell(1,1).Range.InlineShapes.AddPicture(RPa th)
End With
Anyone understand why the pictures don't print