Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por RicardoSA
#55636
Falaa serhumaninhos
beleza?

Podem me dar uma força?

Preciso que a minha assinatura padrão (Assinatura AD) do outlook seja enviada em cada e-mail pela macro, como faço ? tudo que testei não consegui

Obs: A assinatura contem texto e também uma imagem (logo) da empresa

Segue o código que estou usando atualmente, que obtive com apoio do Afonso
Código: Selecionar todos
Sub Envia_Email_CAnexo()

    Dim OutApp As Object
    Dim OutMail As Object
    Dim ws As Worksheet: Set ws = Sheets("Planilha1")
    Dim enviad As String
    enviad = 0
    'Path do anexo ao email a ser enviado
    Set Rng = ws.Range(Range("F2"), ws.Range("F" & Rows.Count).End(xlUp))
    For Each cell In Rng
        rw = cell.Row
        Path = cell.Value
        If Path <> "" Then
            ' endereco de Email
            ToNome = Cells(rw, 3).Value
                    AttachFile = Path
                    MailBody = Cells(rw, 5).Value
                    Set OutApp = CreateObject("Outlook.Application")
                    Set OutMail = OutApp.CreateItem(o)
                    With OutMail
                        .Subject = Cells(rw, 4).Value
                        .To = ToNome
                        .Body = MailBody
                        .Attachments.Add (AttachFile)
                        .Display
                        '.Send
                        enviad = enviad + 1
                    End With
                    Set OutMail = Nothing
                    Set OutApp = Nothing
                    RecpList = ""
                End If
    Next
    If enviad = 0 Then
    MsgBox "Nenhum email enviado", 64, "AVISO"
    Else
    MsgBox enviad & " enviados da sua lista de emails!", 0, "SUCESSO"
    End If
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord