PDA

View Full Version : Excel sends email with low importance



jackdandcoke
10-01-2008, 11:20 AM
I'm using this code to send an e-mail from excel. it always sends it with low importance, any ideas?



Dim OL As Object
Dim EmailItem As Object
Dim Wb As Workbook

Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Wb = ActiveWorkbook
Wb.Save
With EmailItem
.Subject = "Webathon Reporting"
.Body = "Here is the Report"
.To = "name@place.com"
.Importance = olImportanceNormal
.Attachments.Add Wb.FullName
.Send
End With

Application.ScreenUpdating = True

Set Wb = Nothing
Set OL = Nothing
Set EmailItem = Nothing

Clearly it says to set the importance to normal but when it sends I see it in my sent box as importance low.

Demosthine
10-01-2008, 04:31 PM
Good Afternoon.

You are absolutely correct that clearly you are marking the MailItem with a Normal Importance. I ran the code numerous times via a MsExchange Server and through MsHotmail, both through MsOutlook. The messages are all coming through the serves with the correct Importance Level.

The only other item that I can think of is that somewhere in your Outlook application, there is an override to set it to Low. Let me know if you find out, though. This has me quite curious.

Scott

dcraker
10-02-2008, 08:02 AM
Of the vast majority of codes involving sending from excel, the line for changing importance is typically not there. You could try commenting it out and see if you still get the same results.

'.Importance = olImportanceNormal
Or could you have the options set on your email to send messages with low importance?
From the Outlook 2003 help files
1. On the Tools menu, click Options
2. Under E-mail, click E-mail Options.
3. In the Email Options dialog box, click Advanced Email Options.
4. Under When sending a message, in the Set importance list, click High or Low.

Hope this helps you

dcraker
10-02-2008, 09:20 AM
I had tried your code with the email set to low importance, and I got the same results as you were saying. With the line of Importance set in the Outlook to Low, it will continue to keep it at low regardless of the Macro telling otherwise.
So the above post that I suggested will most likely be the cause of your Low Importance. So if there is some reason why you have all your email set to Low then you may examine other options. I.e. set certain people in your Contacts to have a different importance level using the Rule Wizard, not certain on how strong it is but you could mull it over:think: