Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox
Message
De
03/09/2003 09:33:42
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Listbox
Divers
Thread ID:
00825644
Message ID:
00825644
Vues:
48
Hello,

Below is a code snippet that basically is for when a user wants to select multiple files from a listbox to print to pdf,the list box is populated by an array thisform.laxls which is populated from an adir(). Problem is if i select multiple files it will print the first and last file i selected. However if i run the first code from a command button I get the right result..

So maybe someone can figure this out before i lose any more hair :)
*------code from command button that works, lists correct files selected in list--------
FOR nCnt = 1 TO ThisForm.List1.ListCount

      IF ThisForm.List1.Selected(nCnt)                     

        ThisForm.List1.List(nCnt) && Show item
        ENDIF
   ENDFOR
*------------end first code
*---begin problem code---
CASE thisform.optiongroup2.value  =2
	LOCAL ncnt as integer

FOR ncnt = 1 TO ThisForm.list1.ListCount

	IF ThisForm.list1.Selected(ncnt)
	lcfilename = ThisForm.list1.List(ncnt)
	lcoutputname = substr(lcfilename,1,len(lcfilename) -4)
	loxcel.Workbooks.Open(lcxlspath+lcfilename)
        loxcel.Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
	loxcel.ActiveWorkbook.PrintOut( , ,"1", ,"Acrobat PDFWriter on LPT1:","true", ,lcpdfpath + lcoutputname)
	loxcel.Workbooks.close
	thisform.laxls(ncnt,2) = "PRINTED"
	thisform.list1.requery()
	ENDIF
ENDFOR

ENDCASE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform