Clear All #Define wdPageBreak 7 #Define wdGoToNext 2 #Define wdGoToPage 1 * Create test document with 17 blank pages lcDoc = Forcepath(Sys(2015) + '.doc',Sys(2023)) oWord = Createobject('Word.Application') With oWord .Documents.Add For ix=1 To 16 .Selection.InsertBreak(wdPageBreak) Endfor .ActiveDocument.SaveAs(m.lcDoc) .Quit Endwith * Create test document with 17 blank pages lcPhotoPath = _samples+'\data\graphics\' Use (_samples+'\data\employee') oWord = Createobject('Word.Application') With oWord .Visible = .T. .Documents.Open(m.lcDoc) && Open existing lnAdded = 0 Scan While m.lnAdded < 17 And !Eof() lcPhoto = m.lcPhotoPath+Left(last_name,4)+Left(first_name,4)+'.GIF' If File(m.lcPhoto) .ActiveDocument.InlineShapes.AddPicture( m.lcPhoto, .F., .T.,.Selection.Range) lnAdded = m.lnAdded + 1 Endif .Selection.GotoNext(wdGoToPage) Endscan EndwithPS: Not erasing temp doc. Update _samples... line to point to samples folder.