' ------------------------------------------------------------------------------------ ' WIA_PrintPic.vbs ' This scritp uses the WIA interface for printing the currently selected pictures. ' The standard Photo Printing Wizard will show up to allow you to select the printer, ' the page layout and start the printing. ' Note: Windows XP SP1 or better required. ' ------------------------------------------------------------------------------------ Option Explicit Dim v 'As Vector dim wCD, alb, pic, i, n, k app.ClearTrace Set wCD = CreateObject("WIA.CommonDialog") ' Create a vector for holding the names of the pictures to print Set v = CreateObject("WIA.Vector") set alb = app.GetCurrentAlbum n = alb.nbPicture k = 0 for i = 0 to n-1 set pic = alb.GetPicture(i) if pic.bSelected then ' The picture is selected so add it to the vector v.Add alb.ExpandMacro( pic, "%RP" ) k = k+1 end if next if k > 0 then wCD.ShowPhotoPrintingWizard v app.trace "Done!", -1, TRACE_OK else app.trace "Nothing to print !", -1, TRACE_WARNING end if