PDA

View Full Version : [SOLVED] Email Priority



gibbo1715
03-23-2005, 03:57 AM
I have the code below, i know i can set the priority(high, medium, low ) in outlook but not sure how to do it from this macro, can I also generate a receipt as well from this macro when they have received or read the email message?


Private Sub btnEmail_Click()
'Variable declaration
Dim oApp As Object, _
oMail As Object
'Create and show the outlook mail item
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
With oMail
'Uncomment the line below to hard code a recipient
.To = ""
'Uncomment the line below to hard code a subject
.Subject = "Subject"
'use .Display to just show the mail
.Body = "Body"
.Display
End With
Set oMail = Nothing
Set oApp = Nothing

Many Thanks

Gibbo

sandam
03-23-2005, 04:05 AM
This should work for ya :)



.Importance = olImportanceNormal
'Then just change it to either olImportanceLow, or
'olImportanceHigh for your preference




As for the receipt, not sure. Have you checked the Kb. I know that a lot of the email stuff I worked on a while ago, I got out of there.

gibbo1715
03-23-2005, 04:26 AM
many thanks, that works for me, just need the other bit now

cheers

Gibbo

brettdj
03-23-2005, 04:32 AM
Gibbo,

I suggest that you set a reference to the Outlook object via Tools - Reference in the VBE. You can then scan the properties of the mailitem using intellisense



Private Sub btnEmail_Click()
'Variable declaration
Dim oApp As Outlook.Application, _
oMail As Outlook.MailItem
'Create and show the outlook mail item
Set oApp = New Outlook.Application
Set oMail = oApp.CreateItem(0)
With oMail
'Uncomment the line below to hard code a recipient
.To = ""
'Uncomment the line below to hard code a subject
.Subject = "Subject"
'use .Display to just show the mail
.Body = "Body"
.Importance = olImportanceNormal
.ReadReceiptRequested = True
.Display
End With
Set oMail = Nothing
Set oApp = Nothing
End Sub



Cheers

Dave

gibbo1715
03-23-2005, 04:38 AM
thanks Dave much appreciated

sandam
03-23-2005, 05:09 AM
ahhh. i kept on looking for just ReadReceipt. Good one brettdj . I'll keep that one in mind myself :)