-
Add signature to email
Is there a way to write a code within this one that will automatically put my signature to the end of the email?
[VBA]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
[/VBA]
-
How about just include the text of your signature in the .body of the message.
AFAIK, there is no Signature item that can be added to a MailItem.
-
Well the issue is, normally when I go into outlook and create a new message, my signature is automatically included in the message. But when I generate a new email from the above macro, for some reason my signature is not included in that email. Although I could just make my siganture in the .body of the message, this macro is being used my two people so I am trying to generalize it so we run this macro without having to change the signature at the bottom of the email. I would essentially have to create two similar macros, one with .body of his name, etcc.. and one with .body with my name, etc.. So I am trying to not use the .body and just have a command that inserts the signature for the outlook being used.
-
Hi, Lartk,
maybe this article may help with your issue: Insert Outlook Signature in mail.
CIao,
Holger
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules