0% found this document useful (0 votes)
14 views2 pages

Código para Enviar Emai Com Assinatura: Segundo Programa

This document contains code snippets for sending emails with signatures in VBA and Excel. The first code sample shows how to create an email object in Outlook, get the signature, and add it to the email body. The second sample demonstrates how to send an email with attachments by specifying the recipient, subject, attachment, and body. The third sample contains a loop to clear values in a certain column range. The last sample inserts the current date into a column when the user edits a cell in another column.

Uploaded by

LeandroLCA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Código para Enviar Emai Com Assinatura: Segundo Programa

This document contains code snippets for sending emails with signatures in VBA and Excel. The first code sample shows how to create an email object in Outlook, get the signature, and add it to the email body. The second sample demonstrates how to send an email with attachments by specifying the recipient, subject, attachment, and body. The third sample contains a loop to clear values in a certain column range. The last sample inserts the current date into a column when the user edits a cell in another column.

Uploaded by

LeandroLCA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Cdigo para enviar emai com assinatura

Dim OApp As Object, OMail As Object, signature As String


Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.body
With OMail
'.To = "[email protected]"
'.Subject = "Type your email subject here"
'.Attachments.Add
.body = "Add body text here" & vbNewLine & signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing

Segundo programa.
Private Sub Envio_Click()
Dim appOutlook As Object
Dim olMail As Object
'Verifica se Outlook est aberto. Caso no esteja, criar nova instncia
On Error Resume Next
Set appOutlook = GetObject(, "Outlook.Application")
If appOutlook Is Nothing Then
Set appOutlook = CreateObject("Outlook.Application")
End If
On Error GoTo 0
Set olMail = appOutlook.CreateItem(0) '0 um item de e-mail
With olMail
.To = "[email protected]"
.Subject = "Desenho divergente"
'
.Attachments.Add = "c:\benzadeus\arquivo.txt"
.Body = "Verificar a planilha de desenhos divergentes."
.Send 'ou .Send
End With
End Sub
Loop numa determinada coluna

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim counter As Integer


For counter = 3 To 32000 (determina o numero da celula)
Worksheets("sheet1").Cells(counter, 3).Value = blank
Next counter

End Sub
Private Sub Worksheet_Change(ByVal Target As Range) programa coloca data
na celula pre-determinada
dados = Split(Target.Address, "$")
Dim linha As Integer
linha = dados(2) * 1
If dados(1) = "A" Then
Worksheets("Sheet1").Cells(linha, 4).Value = Now()
End If
End Sub

You might also like