Notifications
Clear all

Enviar link no corpo de email Notes

2 Posts
1 Usuários
0 Reactions
828 Visualizações
(@pamthaires)
Posts: 3
New Member
Topic starter
 

Olá!

Vi uma pergunta similar no fórum mas sem resposta. Alguém sabe como enviar o link para quem receber o e-mail (via Lotus Notes), consiga abrir o arquivo que está salvo na rede? Assim elimina a necessidade de ter que procurar o arquivo...

Obrigada!

 
Postado : 17/03/2017 8:00 pm
(@pamthaires)
Posts: 3
New Member
Topic starter
 

Olá Pessoal, encontrei um código que faz o que eu precisava...fiz algumas adaptações e funcionou certinho...

Tirei o código daqui >>> https://www.mrexcel.com/forum/excel-que ... notes.html

Segue o código original:

Sub Send_HTML_Email()



    Const ENC_IDENTITY_8BIT = 1729

    'Send Lotus Notes email containing links to files on local computer
    
    Dim NSession As Object      'NotesSession
    Dim NDatabase As Object     'NotesDatabase
    Dim NStream As Object       'NotesStream
    Dim NDoc As Object          'NotesDocument
    Dim NMIMEBody As Object     'NotesMIMEEntity
    Dim SendTo As String
    Dim subject As String
    Dim HTML As String, HTMLbody As String
    
    SendTo = "your.email@email.com, another.email@email.com"
    subject = Now & " Lotus Notes HTML MIME email"
    Debug.Print subject
    
    Set NSession = CreateObject("Notes.NotesSession")       'using Lotus Notes Automation Classes (OLE)
    Set NDatabase = NSession.GetDatabase("", "")
    
    If Not NDatabase.IsOpen Then NDatabase.OPENMAIL
    
    Set NStream = NSession.CreateStream
            
    HTMLbody = "< p>Links to files on local computer:< /p>" & _
        "< a href='file:///f:tempexceltest.csv'>test.csv< />< br>" & _
        "< a href='file:///f:tempexcel'>Excel folder< />"
    
    HTML = "< html>" & vbLf & _
            "< head>" & vbLf & _
            "< meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8"" />" & vbLf & _
            "< /head>" & vbLf & _
            "< body>" & vbLf & _
            HTMLbody & _
            "< /body>" & vbLf & _
            "< /html>"
    
    NSession.ConvertMime = False     'Don't convert MIME to rich text
    
    Set NDoc = NDatabase.CreateDocument()
    
    With NDoc
        .Form = "Memo"
        .subject = subject
        .SendTo = Split(SendTo, ",")
        
        Set NMIMEBody = .CreateMIMEEntity
        NStream.WriteText HTML
        NMIMEBody.SetContentFromText NStream, "text/html; charset=UTF-8", ENC_IDENTITY_8BIT
    
        .Send False
        .Save True, False, False
    End With
    
    NSession.ConvertMime = True      'Restore conversion
       
    Set NDoc = Nothing
    Set NSession = Nothing
   
End Sub

Espero que ajude a quem precisar!

 
Postado : 21/03/2017 8:16 am