1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| Sub test1()
'http://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.0/com.ibm.designer.domino.main.doc/H_4_LOTUSSCRIPT_NOTES_CLASSES_REFERENCE.html
'
Dim sess As Object, db As Object ', stream As Object
'Dim mime As Object
Dim html As String
Set sess = CreateObject("Notes.NotesSession")
' Set stream = sess.CreateStream()
Set NUIWorkspace = CreateObject("Notes.NotesUIWorkspace")
Set db = sess.GetDatabase("", "")
If Not db.IsOpen Then db.OPENMAIL
meteo = "fichier.bmp"
che = "\\SRVFILE\temp"
extMeteo = Replace(meteo, Mid(meteo, 1, InStrRev(meteo, ".")), "")
Ligne1 = "fichier.html"
extLigne1 = Replace(Ligne1, Mid(Ligne1, 1, InStrRev(Ligne1, ".")), "")
html = "<center>" & _
"Ce mail a été généré par un automate, merci de ne pas répondre à ce mail." & _
" Pour nous contacter, merci d'utiliser le groupe " & _
"<a href='mailto:Pupitreurs?subject=Météo'>Pupitreurs</a>" & _
"</center>"
'Creation du nouveau document Lotus Notes
Set doc = db.createDocument
doc.Save True, False
doc.Importance = "2" 'Importance du message -> 1 = high, 2 = normal, 3 = low
Dim richText As Object ' NotesRichTextItem
Dim rtpStyle As Object ' NotesrichTextParagraphStyle
Dim navigator As Object ' NotesRichTextNavigator
Set rtpStyle = sess.CreateRichTextParagraphStyle
Set richText = doc.CreateRichTextItem("Body")
rtpStyle.Alignment = ALIGN_CENTER
' A titre de démonstration, utilisation de la session :
' With doc
' .SendTo = ""
' .CopyTo = ""
' .Subject = ""
' .body = ""
' .Importance = "1" 'Importance du message -> 1 = high, 2 = normal, 3 = low
' .Save True, False
' End With
doc.Visible = True
'Edition du document avec l'interface utilisateur
Set NUIdoc = NUIWorkspace.EDITDocument(False, doc)
With NUIdoc
Call .fieldsettext("EnterSendTo", "gbranchard-ext@girc.agirc-arrco.fr")
Call .fieldsettext("Subject", "Météo Applicative RNXE/MJ du " & Format(Now(), "DD/MM/YYYY"))
.GotoField (body)
Call richText.AppendParagraphStyle(rtpStyle)
Call .import(extLigne1 & " File", che & "\" & Ligne1)
Call .import(extMeteo & " Image", che & "\" & meteo)
.send
.Close
End With
Set sess = Nothing
' Liste des filtres d'importation
'ASCII Text
'Binary with Text
'BMP Image
'CGM Image
'GIF Image
'html File
'JPEG Image
'Lotus® 1-2-3®
'lotus PIC"
'Lotus Word Pro®
'Microsoft Excel
'Microsoft RTF
'Microsoft Word
'Network Portable Graphic
'PCX Image
'TIFF 5.0 Image
'Unsupported File as Text
'WordPerfect
'Liste des champs à utiliser avec FieldSetText et GotoField :
'EnterSendTo
'EnterCopyTo
'EnterBlindCopyTo
'DysplayFrom
End Sub |
Partager