' ------------------------------------------------------------------------------------ ' Advance to the next picture and copy keywords and custom fields ' from previous picture ' ------------------------------------------------------------------------------------ Option Explicit const CF_STRING=0 const CF_DATE=1 const CF_TIME=2 dim alb, i, j, k, kw, s set alb = app.GetCurrentAlbum ' Get the keywords dim nbKW, tabKW() nbKW = alb.nbKeyword redim tabKW(nbKW) for i = 0 to nbKW-1 set kw = alb.getKeyword(i) tabKW(i) = kw.sName next ' Get the custom fields dim nbCF, tabCF(), tabCFType() nbCF = alb.nbCustomField redim tabCF(nbCF), tabCFType(nbCF) for i = 0 to nbCF-1 set kw = alb.getCustomField(i) tabCF(i) = kw.sName tabCFType(i) = kw.nType next dim pic, pic2 j = alb.nCurrentPicture Set pic = alb.GetPicture(j) j = j+1 ' Move to the next picture alb.nCurrentPicture = j Set pic2 = alb.GetPicture(j) ' Copy the keywords from the previous picture for j = 0 to nbKW-1 set kw = alb.getKeyword(j) if pic.HasKeyword( kw.sName ) then pic2.SetKeyword kw.sName, True next ' Copy the custom fields from the previous picture for j = 0 to nbCF-1 set kw = alb.getCustomField(j) if kw.nType <> CF_STRING then k = pic.GetCustomFieldDate( kw.sName ) if k <> 0 then pic2.SetCustomFieldDate kw.sName, k else s = pic.GetCustomField( kw.sName ) if len(s) > 0 then pic2.SetCustomField kw.sName, s end if next alb.Redraw