Notifications
Clear all

Exibir .Display na macro de enviar email.

5 Posts
2 Usuários
0 Reactions
1,253 Visualizações
(@kennedyand)
Posts: 12
Active Member
Topic starter
 

Boa tarde!

Conseguem me ajudar com este código.

Preciso que ele exiba a caixa de dialogo para editar o email. (Uso LotusNotes). Mas neste caso ele esta enviando direto.

'envia o email para o operador

Dim noSession As Object, noDatabase As Object, noDocument As Object
Dim obAttachment As Object, EmbedObject As Object
Dim stSubject As Variant, stAttachment As String
Dim vaRecipient As Variant, vaMsg As Variant

'Retrieve the path and filename of the active workbook.
stAttachment = ActiveWorkbook.FullName

'Initiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument
Set obAttachment = noDocument.CreateRichTextItem("stAttachment")

vaRecipient = Worksheets("Enviar").Range("E20")
vaMsg = Worksheets("Enviar").Range("E24")
'Add values to the created e-mail main properties.
With noDocument
.Form = "Memo"
.SendTo = vaRecipient
.Subject = "Erros - Siebel"
.Body = vaMsg
.SaveMessageOnSend = True
End With

'Send the e-mail.
With noDocument
.PostedDate = Now()
.Send 0, vaRecipient
End With

'Release objects from the memory.
Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

'Activate Excel for the user.
MsgBox "O E-Mail foi enviado com sucesso!.", vbInformation

End Sub

 
Postado : 22/03/2017 2:52 pm
(@gesus)
Posts: 44
Eminent Member
 

Tente o Seguinte, substitua de .Send para . Display

'Send the e-mail.
With noDocument
.PostedDate = Now()
.DISPLAY 0, vaRecipient '
End With

 
Postado : 22/03/2017 3:08 pm
(@kennedyand)
Posts: 12
Active Member
Topic starter
 

Não consegui, ele dar erro quando altero.

 
Postado : 23/03/2017 5:05 am
(@kennedyand)
Posts: 12
Active Member
Topic starter
 

Tentei algumas outras formas, mas ainda sem sucesso.

 
Postado : 23/03/2017 7:46 am
(@kennedyand)
Posts: 12
Active Member
Topic starter
 

Alguém consegue auxiliar ?

 
Postado : 24/03/2017 9:13 am