par Stephane Maillard » 26 Juin 2003 à 10:21
Re,Voici un exemple en utilisant MakeResponse :Sub Initialize Dim session As New NotesSession Dim db1 As NotesDatabase 'Dim db2 As New NotesDatabase( "" , "" ) Dim view As NotesView Dim docA As NotesDocument Dim docB As NotesDocument Dim i As Integer Dim theFLName$ Dim EnvTheFLNum$ Dim EnvTheGlobalCust$ Set db = session.CurrentDatabase Set view = db.GetView( "2. Process Fund/Country\ b. Add Fund" ) 'Call db2.Open( "" , "C:\\notes\\data\\templeton\\wwfund\\wwcrfund.nsf") EnvTheFLName$ = session.GetEnvironmentString( "TheFLName" ) EnvTheFLNum$ = session.GetEnvironmentValue( "TheFLNum" ) EnvTheGlobalCust = session.GetEnvironmentString( "TheGlobalCust" ) Set docA = view.GetFirstDocument While Not ( docA Is Nothing ) 'create new docB using form "Fun" Set docB = db.CreateDocument docB.Form = "FUN" Call docB.MakeResponse( docA ) docB.FUNCountry = docA.COUCountry docB.FUNRegion = docA.COURegion docB.FUNFundName = EnvTheFLName$ docB.FUNFundNo = EnvTheFLNum$ docB.FUNCustodian=EnvTheGlobalCust$ docB.FUNCode = docA.COUCode Call docB.Save( True, True ) Set docA = view.GetNextDocument( docA ) Wend End Sub[%sig%]
Cordialement
Stéphane Maillard