par Raziel » 07 Mai 2003 à 10:41
Pour Leila,Voici ce que tu dois faire pour que ce code fonctionne en V4.6Tout d'abord tu créé un masque que tu appele par exemple "SelectColonnes"Dans ce masque, tu créé une zone de présentation. Dans cette zone, tu créé un champ du type "Case à cocher" que tu nomme "SelectColonnes".Pour ce champ, tu choisi choix via formule et tu mets comme formule le code suivant :@GetProfileField("Exportation" ; "NomColonnes"; @UserName)Ensuit, toujours dans le masque, évènement QueryClose, tu mets le code suivant :@SetProfileField("Exportation" ; "SelectColonnes"; SelectColonnes; @UserName)ENFIN, REMPLACES LE CODE SUIVANT :Sub InitializeDim Session As New notessessionDim ws As New notesuiworkspaceDim db As notesdatabaseDim Vue As notesviewDim NomCol() As StringDim TabCol As VariantDim Indice As IntegerSet db = Session.currentdatabaseSet Vue = db.getview("($Inbox)")Redim NomCol(Ubound(Vue.Columns)) As StringIndice = 0Forall Colonne In Vue.ColumnsIf Colonne.Title <> "" And Colonne.IsHidden = False Then NomCol(indice) = Colonne.Title + "|" + Str$(Indice)Indice = Indice + 1End ForallTabCol = ws.Prompt(PROMPT_OKCANCELLISTMULT, "Exportation vers Excel", _"Sélectionnez les colonnes à exporter","" , Fulltrim(NomCol))If Not Isempty(TabCol) ThenFor indice = 0 To Ubound(TabCol)TabCol(Indice) = Trim(Right(TabCol(Indice), 2))NextCall ExtractNotesToExcel(Vue, TabCol)End IfEnd SubPAR :Sub Initialize Dim Session As New notessession Dim ws As New notesuiworkspace Dim db As notesdatabase Dim Vue As notesview Dim DocProfil As notesdocument Dim NomCol() As String Dim TabCol As Variant Dim Indice As Integer Set db = Session.currentdatabase Set Vue = db.getview("($Inbox)") Redim NomCol(Ubound(Vue.Columns)) As String Indice = 0 Forall Colonne In Vue.Columns If Colonne.Title <> "" And Colonne.IsHidden = False Then NomCol(indice) = Colonne.Title + "|" + Str$(Indice) Indice = Indice + 1 End Forall Set DocProfil = db.getprofiledocument("Exportation", session.username) DocProfil.NomColonnes = Fulltrim(NomCol) DocProfil.save True, True ' TabCol = ws.Prompt(PROMPT_OKCANCELLISTMULT, "Exportation vers Excel", _' "Sélectionnez les colonnes à exporter","" , Fulltrim(NomCol)) If ws.DialogBox("SelectColonnes", True, True, False, True, True, False, "Exportation vers Excel") Then TabCol = DocProfil.getitemvalue("SelectColonnes") TabCol = Fulltrim(TabCol) If TabCol(0) <> "" Then For indice = 0 To Ubound(TabCol) TabCol(Indice) = Trim(Right(TabCol(Indice), 2)) Next Call ExtractNotesToExcel(Vue, TabCol) End If End If End Sub
Raziel
L'administration est un lieu ou les gens qui arrivent en retard croisent dans l'escalier ceux qui partent en avance. [Georges Courteline]