Auto Email - Setting Importance

Status
Not open for further replies.

ColinKJ

Well-known Member
Joined
Jan 27, 2009
Messages
983
Hi,

I'm using the following code to generate an email from excel (2003):

Code:
Set OutApp = CreateObject("Outlook.Application")
    On Error Resume Next
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
 
    On Error Resume Next
    With OutMail
        .To = Eadd
        .CC = ""
        .BCC = ""
        .Subject = Su
        .body = body
        .ReadReceiptRequested = True
        .display
    End With
    On Error GoTo 0

Now I want to be able to set the Importance to "High", can anyone help me with the correct syntax.

Regards

ColinKJ
 
within your WITH construct try

.Importance = olImportanceHigh
 
Upvote 0
Hi jimrward,

Someone else sugested I try that, and while it does set the Importance, for some reason it sets it to "Low", any ideas?.

ColinKJ
 
Upvote 0
Have tried this and get same :rofl:

Only thoughts are - are your Outlook settings over riding the excel code....... Tools/options/email - email options/advanced.

Could try creating a new rule in outlook...
 
Upvote 0
Colin

In Outlook VBA the constant olImportanceLow is 0.

If you don't have a reference to Outlook or haven't declared it as a constant or variable with a value then in Excel VBA olImportanceHigh will be 0.

In Outlook VBA olImportanceHigh = 2.

You could try one of these.

1 Set a reference the Outlook Object Library, Tools>References...

2 Use a constant.

Const olImportanceHigh = 2

3 Use a variable, but the value doesn't change so that's probably not worth doing.:)
 
Upvote 0
Status
Not open for further replies.

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