Exporter des données lotus notes vers excel
Bonjour à tous,
j'ai trouvé un code*
sur internet me permettant de faire un expert de données de lotus notes (D'un mail je présume, enfin espère) vers Excel.
Cependant je ne sais pas comment ouvrir (accéder) à l'interface me permettant de coder dans Lotusnotes (Script ?).
Il y a - t- il un outil à installer ? (genre ODBC Notes ou NotesSQl).
merci à tous,
J'en profite au passage, j'ai un code** vba qui me permet d'envoyer mon classeur excel en pièces jointe via lotus, quelqu'un sait comment faire pour ne pas envoyer tout le classeur mais juste feuille par feuille (pour chaque destinataire différent), en passant peut être par le corp du message et non pas la pièce jointe ? Le but ultime vous l'avez compris, c'est de lancer ma macro excel, chaque me répond en me rénvoyant un message préparémétré qui modifie mon fichier excel (une sorte d'intéraction).
*
ReportPath = "D:TempExcelFile.xls"
Set oRs = CreateObject("ADODB.Recordset")
oRs.Open "Select * from EmpData",
{Provider = "Microsoft.Jet.OLEDB.4.0";Data Source=}
& ReportPath & {; Extended
Properties="Excel 8.0;HDR=NO:" },1,3
For I = 1 To 200
oRs.Addnew
oRs(0).Value = "Emp#" & Trim$(Cstr(I))
oRs(1).Value = "Employee Name" & Trim$(Cstr(I))
Next
oRs.Update
oRs.Close
_____________
**en vba (sous excel donc)
Sub UseLotus()
Dim Session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim object As Object
Dim fs As Object
Dim Principaux(2) As String
Dim Copies(3) As String
Dim dir As Object
Dim inti As Integer
Dim passwd As String
On Error GoTo TraiteErreur
'Demande le password Lotus(Dans le cas ou la session necessite un passwd)
passwd = InputBox("Entrer votre password Lotus:", "Password")
' Création de la session Notes
Set Session = CreateObject("Lotus.NOTESSESSION")
'Ouverture d'une session NOTES
Call Session.Initialize(passwd) 'si pas de passwd pas de parametre pour initialize
Set dir = Session.GETDBDIRECTORY("FranceServer1/DCI/BME/Omnia Group")
Set db = dir.OpenMailDatabase
' Création d'un document
Set doc = db.CREATEDOCUMENT
'affectation du type mail
Call doc.APPENDITEMVALUE("Form", "Memo")
Call doc.APPENDITEMVALUE("Sendto", "exemple@gmail.com")
Call doc.APPENDITEMVALUE("subject", "sujet")
doc.SAVEMESSAGEONSEND = saveit 'sauvegarde du mail à l envoi
Set rtitem = doc.createRichTextItem("Body")
Dim nom As String
nom = ThisWorkbook.FullName
'Attachement du classeur au mail
Set object = rtitem.embedObject(1454, "", nom, "")
Call doc.Send(True)
Set object = Nothing
Set rtitem = Nothing
Set doc = Nothing
Set db = Nothing
Set Session = Nothing
Exit Sub
TraiteErreur:
MsgBox "Erreur Critique durant l envoi .", vbCritical, "Error"
Set object = Nothing
Set rtitem = Nothing
Set doc = Nothing
Set db = Nothing
Set Session = Nothing
Set fs = Nothing
End Sub
Merci tout le monde
j'ai trouvé un code*
sur internet me permettant de faire un expert de données de lotus notes (D'un mail je présume, enfin espère) vers Excel.
Cependant je ne sais pas comment ouvrir (accéder) à l'interface me permettant de coder dans Lotusnotes (Script ?).
Il y a - t- il un outil à installer ? (genre ODBC Notes ou NotesSQl).
merci à tous,
J'en profite au passage, j'ai un code** vba qui me permet d'envoyer mon classeur excel en pièces jointe via lotus, quelqu'un sait comment faire pour ne pas envoyer tout le classeur mais juste feuille par feuille (pour chaque destinataire différent), en passant peut être par le corp du message et non pas la pièce jointe ? Le but ultime vous l'avez compris, c'est de lancer ma macro excel, chaque me répond en me rénvoyant un message préparémétré qui modifie mon fichier excel (une sorte d'intéraction).
*
ReportPath = "D:TempExcelFile.xls"
Set oRs = CreateObject("ADODB.Recordset")
oRs.Open "Select * from EmpData",
{Provider = "Microsoft.Jet.OLEDB.4.0";Data Source=}
& ReportPath & {; Extended
Properties="Excel 8.0;HDR=NO:" },1,3
For I = 1 To 200
oRs.Addnew
oRs(0).Value = "Emp#" & Trim$(Cstr(I))
oRs(1).Value = "Employee Name" & Trim$(Cstr(I))
Next
oRs.Update
oRs.Close
_____________
**en vba (sous excel donc)
Sub UseLotus()
Dim Session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim object As Object
Dim fs As Object
Dim Principaux(2) As String
Dim Copies(3) As String
Dim dir As Object
Dim inti As Integer
Dim passwd As String
On Error GoTo TraiteErreur
'Demande le password Lotus(Dans le cas ou la session necessite un passwd)
passwd = InputBox("Entrer votre password Lotus:", "Password")
' Création de la session Notes
Set Session = CreateObject("Lotus.NOTESSESSION")
'Ouverture d'une session NOTES
Call Session.Initialize(passwd) 'si pas de passwd pas de parametre pour initialize
Set dir = Session.GETDBDIRECTORY("FranceServer1/DCI/BME/Omnia Group")
Set db = dir.OpenMailDatabase
' Création d'un document
Set doc = db.CREATEDOCUMENT
'affectation du type mail
Call doc.APPENDITEMVALUE("Form", "Memo")
Call doc.APPENDITEMVALUE("Sendto", "exemple@gmail.com")
Call doc.APPENDITEMVALUE("subject", "sujet")
doc.SAVEMESSAGEONSEND = saveit 'sauvegarde du mail à l envoi
Set rtitem = doc.createRichTextItem("Body")
Dim nom As String
nom = ThisWorkbook.FullName
'Attachement du classeur au mail
Set object = rtitem.embedObject(1454, "", nom, "")
Call doc.Send(True)
Set object = Nothing
Set rtitem = Nothing
Set doc = Nothing
Set db = Nothing
Set Session = Nothing
Exit Sub
TraiteErreur:
MsgBox "Erreur Critique durant l envoi .", vbCritical, "Error"
Set object = Nothing
Set rtitem = Nothing
Set doc = Nothing
Set db = Nothing
Set Session = Nothing
Set fs = Nothing
End Sub
Merci tout le monde