IF LEFT(SYS(16,0),9) = "PROCEDURE" m._graphicspath = addbs(SUBSTR(SYS(16,0),AT(" ",SYS(16,0),2)+1))+"GRAPHICS\" ELSE m._graphicspath = addbs(SYS(16,0))+"GRAPHICS\" ENDIF m._printbitmap = m._graphicspath+"mybitmap.bmp"In my report form, the file expression for the bitmap is set to :
(IIF(TYPE("M._PRINTBITMAP") = "C" .AND. FILE(M._PRINTBITMAP),LOCFILE(M._PRINTBITMAP),""))FRX2Word does not have a problem with this rather convoluted method of specifying the file in the report form. It always includes the bitmap in the report with no problem. With this code in the report form file expression for the bitmap, if it cannot find the file or if the variable is not properly set up or is out of scope, it leaves it out.
Case m.nobjtype=17 and empty(m.vexpr) If ! empty(m.cpicture) If ! file(m.cpicture) if type(m.cpicture) # "U" && picture passed as an expression cpicture = evaluate(m.cpicture) && evaluate expression endif if file(m.cpicture) && picture exists in VFP path cpicture=locfile(m.cpicture) && ensure full path to picture is specified for WORD else if empty(fullpath(.reporthome+m.cpicture)) cpicture=locfile(m.cpicture) else cpicture=fullpath(.reporthome+m.cpicture) && assume that picture exists in reporthome endif endif else if juststem(m.cpicture)+"."+justext(m.cpicture) = m.cpicture && only picture with no path specified cpicture=locfile(m.cpicture) && ensure full path to picture is specified to WORD endif Endif If file(m.cpicture) =m.odocshapes.addpicture(m.cpicture,.f.,.t.,m.nleft,m.ntop,m.nwidth,m.nheight) && ,m.odoc.sections(m.npage).range) Endif EndifI suspect that the full path is not being passed to Word and somehow the above code doesn't set cpicture to fullpath to the bitmap. If this the case you could probably add cpicture = locfile(cpicture) just before the call to m.odocshapes.addpicture to make sure that it gets set in all cases.