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:
Thank you!!![]()
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
Bookmarks