+ Reply to Thread
Results 1 to 8 of 8

Sending e-mail, copy the direct recipient cell

Hybrid View

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Sending e-mail, copy the direct recipient cell

    I need a code to insert into a macro that I use ...
    I would like that when clicked the button, the active sheet (PDF) was sent directly to the email that the former cell (W6). this phone I use VLOOKUP to automatically fill in the email client according to the database.
    he is working to convert to PDF and opening the window sending the email.Gostaria only add code to populate an email automatically.


    I am using the code below:
    Sub Envia_email()
    
    ' Envia_email Macro
    ' envia documento por email.
    
    
    'Salva o arquivo
    ActiveWindow.SmallScroll Down:=-15
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "C:Desktop\CONFIRMAÇÃO DE ENTREGA.pdf", Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
    False
    ActiveWindow.SmallScroll Down:=21
    
    
    
    'Nome do Arquivo a ser anexado
    Filename = "C:\Desktop\CONFIRMAÇÃO DE ENTREGA.pdf"
    
    
    
    'Envia o email
    
    Set myActiveSheet = CreateObject("Outlook.Application")
    Set objMail = myActiveSheet.CreateItem(olMailItem)
    Set myAttachments = objMail.Attachments
    
    With objMail
    .TO = ""
    .Subject = "Confirmação de Entrega de Equipamento(s) &data &hora"
    .HTMLBody = "Prezado cliente, essa é uma confirmação de entrega dos equipamentos enviados para reparo, para confirmar o recebimento dos mesmos, basta abrir o arquivo PDF em anexo e clicar no link em <u>verde</u>. Caso ainda não tenha recebido os equipamentos e queira informar nossa equipe de logistica, basta clicar no link em <u>vermelho</u>."
    myAttachments.Add Filename
    .display
    
    
    End With
    
    End Sub
    Thank you!!
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Sending e-mail, copy the direct recipient cell

    Hi.
    anyone have any suggestions?
    Thank you!!

  3. #3
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Sending e-mail, copy the direct recipient cell

    Hii marreco,
    pls clarify, you need a code to pickup email id that is reflecting in W6??

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Sending e-mail, copy the direct recipient cell

    Hi.
    Email is the W6 in the cell, then the code has to take this cell and send to the recipient.

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Sending e-mail, copy the direct recipient cell

    hi.
    Any idea?

  6. #6
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Sending e-mail, copy the direct recipient cell

    Apologize that i stuckup with my work here.....

    In your code pls inlude

    HTML Code: 
    replace you To code with below

    HTML Code: 
    While executing the code, whatever the mail id given in W6, will be picked by outlook as To address

    Hope this helps...

  7. #7
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Sending e-mail, copy the direct recipient cell

    Hi.
    where should I put this line of code?

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Sending e-mail, copy the direct recipient cell

    Hi.
    someone could help me? Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1