I have created a macro, in Excel, to send mail.
I want to set the importance as high. I have tried
.Importance = 2
.olImportanceHigh = 2
.Importance = olImportanceHigh
It says Object does not support property or method.
ws1.Activate
ToArray = wb1.Sheets("Report").Cells(3, 34).Value
CCArray = wb1.Sheets("Report").Cells(3, 35).Value
Subject = subject1
Content = wb1.Sheets("Report").Cells(3, 36).Value
ws1.Range("B3:P31").Select
ActiveWorkbook.EnvelopeVisible = True
With wb1.Sheets("New Report").MailEnvelope
.Introduction = Content
.Item.To = ToArray
.Item.CC = CCArray
.Item.Subject = Subject
.Item.attachments.Add (wb2.FullName)
.Importance = olImportanceHigh
.Item.Send
End With
Application.DisplayAlerts = False
It's a property of the MailItem and not the MailEnvelope so you need to use:
.Item.Importance = 2