Insertone=0 Inserttwo=0 lmultipage=.F. SCAN Newpath=Newpath WAIT WINDOW m.Newpath NOWAIT CREATE CURSOR BillFile (POS Varchar(254)) APPEND FROM (m.Newpath) SDF SELECT Billfile GO Bottom DO WHILE NOT BOF() IF LEFT(POS,8)='(Page 1)' cTextone='<</Duplex false/PageSize [595 842] /Tumble false /ManualFeed false /MediaPosition 0>> setpagedevice' Insertone=1 Inserttwo=0 ENDIF IF LEFT(POS,8)='(Page 3)' lmultipage=.T. ENDIF IF LEFT(POS,8)='(Page 2)' Insertone=0 Inserttwo=1 IF lmultipage=.T. cTexttwo='<</Duplex true /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice' ELSE cTexttwo='<</Duplex false /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice' ENDIF lmultipage=.F. ENDIF IF POS='%%BeginPageSetup' IF Insertone=1 INSERT Blank Replace pos WITH cTextone Skip-2 Insertone=0 Inserttwo=0 ENDIF ENDIF IF POS='%%BeginPageSetup' IF Inserttwo=1 INSERT Blank Replace pos WITH cTexttwo Skip-2 Insertone=0 Inserttwo=0 ENDIF ENDIF Skip-1 WAIT WINDOW 'Remaining Records...'+ALLTRIM(STR(RECNO())) NOWAIT ENDDO Set Textmerge On Set Textmerge To (m.NEWPATH) Noshow Scan \\<< TRIM(POS) >> \ Endscan Set Textmerge To Set Textmerge Off SELECT New_bills ENDSCANRegards