Lartk
03-08-2013, 12:33 PM
Is there a way to write a code within this one that will automatically put my signature to the end of the email?
Sub EmailAAM()
Const FILE_ATTACH As String = _
"G:\KL\MBWB\AAA.xls"
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim Lastrow As Long
Dim bodyText As String
Dim i As Long
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
With oMailItem
Set oRecipient = .Recipients.Add("test@aol.com")
oRecipient.Type = 1
.CC = "test@aol.com"
.Subject = "YOU BUY"
.body = " List. Please see the attached document for item details." & vbNewLine & vbNewLine & _
"can." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks."
If Dir(FILE_ATTACH, vbNormal) <> "" Then
.Attachments.Add ("G:\KL\MBWB\AAA.xls")
.Save
End If
End With
End Sub
Sub EmailAAM()
Const FILE_ATTACH As String = _
"G:\KL\MBWB\AAA.xls"
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim Lastrow As Long
Dim bodyText As String
Dim i As Long
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
With oMailItem
Set oRecipient = .Recipients.Add("test@aol.com")
oRecipient.Type = 1
.CC = "test@aol.com"
.Subject = "YOU BUY"
.body = " List. Please see the attached document for item details." & vbNewLine & vbNewLine & _
"can." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks."
If Dir(FILE_ATTACH, vbNormal) <> "" Then
.Attachments.Add ("G:\KL\MBWB\AAA.xls")
.Save
End If
End With
End Sub