VBA Mail signature missing

santhoshlk

Board Regular
Joined
Feb 6, 2006
Messages
206
hi dudes...

kinldy help me...

Iam using a macro to send mass mails to my clients attaching a file to each

my code is like this:

Sub Mail_Cust()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailSubject As String
Dim EmailSendTo As String
Dim MailBody As String

Path = "Y:\Customers\Statements of Accounts\20111102\"

'Select Row Number of customer to email
'rownum = InputBox("enter a row number from 1 to x")

'Set Rng = Range(Range("D2:D50"), Range("D" & Rows.Count).End(xlUp))

Dim rng As Range: Set rng = Range(Range("D2:D50"), Range("D" & Rows.Count).End(xlUp))
Dim cell As Range
Dim rowNum As Long
Dim fileNme As String

For Each cell In rng
rowNum = cell.Row

If cell.Value <> "" Then

EmailSendTo = Cells(rowNum, 4).Value
fileNme = Path & Cells(rowNum, 1).Value & ".pdf"

' Message subject
EmailSubject = Cells(rowNum, 6).Value

'Subject string
Msg = "Dear customer," & vbNewLine & vbNewLine
Msg = Msg & "Please find attached the Statement of Accounts as at 31st October 2011" & vbNewLine
Msg = Msg & "Kindly arrange to pay against the due invoices immediately. " & vbNewLine & vbNewLine
Msg = Msg & "Thanks & Regards," & vbNewLine & vbNewLine
Msg = Msg & ""
Msg = Msg & "" & vbNewLine
Msg = Msg & "" & vbNewLine
MailBody = Msg



'Send Mail
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(o)
With OutMail
.Subject = EmailSubject
.To = EmailSendTo
.body = MailBody
.Attachments.Add fileNme
.Display
'.Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
End If
Next
End Sub


now my prob is when the macro goes for a new mail with attachments and mail body and all... it misses my outlook signature.

if i am creating a new mail signature appears. but when i run from macro my signature is missing... can any one help....
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
When you set the Body property to MailBody you are overwriting whatever was there. The links provided in the previous post should help.
 
Upvote 0

Forum statistics

Threads
1,226,697
Messages
6,192,510
Members
453,727
Latest member
tuong_ng89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top