473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Setting Message Priority in Visual Basic

Hi all,
I have an Access 2000 Database that is programed to send out emails and
is working fine except i would like to change the message priority to
High so it buzzes people using blackberries when they recieve it.
Below is my code to send the emails and i added a line "olMail.Priority
= MailPriority.High" to try and set the priority. since i added it i
recieve an error stating "SendEmail: Object Required". Can anyone
help?

Sub SendEmail(strTo As String, Optional MessageID As Integer = 0)

On Error GoTo Err_SendEmail
Dim olApp As New Outlook.Application

Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon

Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)

olMail.To = strTo
olMail.Subject = txtMsgSubject.Value
olMail.Body = txtMsgBody.Value & vbCrLf & "MsgID:" & MessageID
olMail.Priority = MailPriority.High 'Added this line to change the
priority and now it fails
olMail.Send
olNs.Logoff
Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing
Exit_SendEmail:
Exit Sub

Err_SendEmail:
WriteToLog ("SendEmail: " & Err.Description)
Resume Exit_SendEmail
End Sub

Oct 18 '06 #1
0 993

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Croft | last post by:
Hello. Can someone please tell me how to set the priority of an email message sent from an ASP script using CDOSYS as below - set oCdoMsg = server.createobject("CDO.Message") oCdoMsg.from=......
1
by: decrypted | last post by:
I want my users to be able to specify where thier configuration files are located for a windows service. Since having startup params don't seem to be a real option here I want to use the...
1
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor...
5
by: Yifan | last post by:
Hi Could any one tell me what project property controls the setting of '/RTC1' option? Now I have a project which has this build error "Command line error D2016 : '/RTC1' and '/clr' command-line...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
3
by: Art Krumsee | last post by:
Is there a way to lower an application's priority from within the application itself? I have a vb.net app that's using too much of the CPU and I'd like to be able to throttle it back some. Art
3
by: Martin | last post by:
How does one set up basic authentication on an HttpListener? I know I need to set the HttpListener.AuthenticationSchemes to AuthenticationSchemes.Basic but then I'm unsure how and against what...
0
by: Jerry Spivey | last post by:
Hi, I'm a SQL Server DBA and I'm trying to get a listing of the SQL Servers on the network. I installed Visual Basic 2005 Express edition and used the SQL Server 2005 ServerInfo sample which...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.