-2
My macro does not send emails... it has the following options, open Outlook and do not send email, or send... but it just opens and does not send..
**' VERIFICAR SE DEVE ENVIAR OU APENAS EXIBIR O EMAIL
If Worksheets("SUPORTE").[SUPORTE_TIPO_ENVIO] = "Enviar" Then
.Display
SendKeys "{SEND}", True ' <<< ALGUMAS VEZES NÃO ENVIAVA IMAGEM USANDO O SEND'
Else
.Display
SendKeys ("^{Enviar}"), True
End If**
This code does not send email it only simulates the pressing of a key. To send an email in VBA you have to activate a class object
Outlook.Application
.– Augusto Vasques
I managed to solve doing this Sendkeys " {Enter}", True When opening the outlook window it presses the shortcut crtl+enter and sends... but on the machine in question it does not work
– Hugo Wellington Borges
Instead of opening a window and simulating a click or pressing keys use the Microsoft Otlook API. I write this because user interfaces change over time, if it is not part of the Application is part of the Operating System the API also evolves but with each evolution it maintains compatibility with previous versions.
– Augusto Vasques
See if this code helps you
– danieltakeshi
@danieltakeshi you did very well in this code +1.
– Augusto Vasques