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 andriessen
Posts
#61526
Boa tarde!
Estou usando o codigo abaixo e esta funcionando funcionando mas queria saber como escolher a conta que vai enviar.

Sub EnviarComunicadosProp()

Linha = 2
While Cells(Linha, 1) <> ""
If Cells(Linha, 7) = "" Then


'Set OutAccount = Outlook.Account(1)


Set objeto_outlook = CreateObject("Outlook.Application")
Set dEmail = objeto_outlook.CreateItem(0)
Set OutAccount = dEmail.Session.Accounts.Item(2)
dEmail.display

dEmail.To = Cells(Linha, 3).Value
'dEmail.BCC = "frank@standbygeradores.com.br"
dEmail.Subject = "Teste!"

dEmail.Body = " " & Cells(1, 28).Value & " " & Cells(Linha, 2).Value & "!" & vbNewLine & vbNewLine _
& Cells(1, 11).Value & vbNewLine & vbNewLine _
& "Atenciosamente," & vbNewLine & vbNewLine & Cells(2, 11).Value

dEmail.Attachments.Add (ThisWorkbook.Path & "\" & Range("k4"))
dEmail.Send

Cells(Linha, 7).Value = Now()
End If
Linha = Linha + 1

Wend
MsgBox "Mensagens enviadas!"
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing


End Sub


Obrigado
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