Send Object with read receipt

buaile

New member
Local time
Today, 22:11
Joined
Apr 18, 2003
Messages
6
Hi folks,

I am trying to send a report using docmd.sendobject on the click of a command button.

I have this working fine.

The problem is I would like to request a read and / or delivery receipt. Is this possible?

I am using Access 2000 and Outlook 2000.

thanks
 
buaile said:
Hi folks,

I am trying to send a report using docmd.sendobject on the click of a command button.

I have this working fine.

The problem is I would like to request a read and / or delivery receipt. Is this possible?

I am using Access 2000 and Outlook 2000.

thanks

No it is not possible...because sendobject isnt part of the outlook object model. However, your problem has a solution, that would be to scrape the horrible sendobject model, which is buggy, and re-write this portion of your code using the Outlook object model.

I am assuming you are using Outlook.

Jon
 
Re: Re: Send Object with read receipt

mission2java_78 said:


No it is not possible...because sendobject isnt part of the outlook object model. However, your problem has a solution, that would be to scrape the horrible sendobject model, which is buggy, and re-write this portion of your code using the Outlook object model.

I am assuming you are using Outlook.

Jon

Thanks Jon, I didn't think it was possible, I will try your suggestion.
 
Re: Re: Re: Send Object with read receipt

buaile said:


Thanks Jon, I didn't think it was possible, I will try your suggestion.

Let me know if you need help.

Jon
 
Re: Re: Re: Send Object with read receipt

Make sure you mark off the outlook object model in your references.

This is free for anyone to use.
Code:
Public Sub SendReport()
On Error Goto Hell

Dim NameSpace As Object
Dim EmailSend As MailItem
Dim EmailApp As Object
Dim strUser As String

strUser = "joe@momma.com"
Set EmailApp = CreateObject("Outlook.Application")    'using the outlook object
Set NameSpace = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

EmailSend.Subject = "Here's your report"
EmailSend.Body = "The Report you wanted..."
EmailSend.Attachments.Add("source/path")
EmailSend.ReadReceiptRequested=True      'receipt request

EmailSend.Recipients.Add (strUser)              'send to?
EmailSend.Save                                    'you MUSt save emails with attachments
EmailSend.Send  'send the email

Heaven:
Set EmailSend=Nothing
Exit Sub
    
Hell:
MsgBox Err.Description, vbCritical, "Error #: " & Err.Number
Resume Heaven
    
End Sub

Jon
 
Re: Re: Re: Re: Send Object with read receipt

Wow, that was quick. I tip my hat to you kind sir.

thanks a mill

B
 
Re: Re: Re: Re: Re: Send Object with read receipt

No Problem.

The outlook object model is very flexible. I guess besides the security outlook has..this model isn't shabby at all. Besides you can also assign tasks using this object model. A lot of companies want applications that have a method of sending some sort of email to inform someone about something that needs to be done. Having the task feature is quite helpful in this case since end users NEED to accept / decline a task. With an email someone can easily open it, and delete it. But with a task..a user has to accept / decline it. If they delete it a message is sent back to the originator :p

Jon
 
mission,

Where do you find those commands like

EmailSend.ReadReceiptRequested=True 'receipt request


I mean where do you look for references or do you just remember everything off the top of you head?
 
chewy said:
mission,

Where do you find those commands like

EmailSend.ReadReceiptRequested=True 'receipt request


I mean where do you look for references or do you just remember everything off the top of you head?

I'm a genius :-)...just kidding.

After you've used a program over and over (vb / vba) you usually remember things. Or sometimes its all trial and error. Most of the time when someone asks something about Outlook than right off the bat I can tell whether its possible or not, reason being is..anything you can do manually in outlook means you can do it programmitically. If you can set a level status (priority) on an email than you should know right away there is a method / property which sets the status of an email. If you need to use the follow up feature on an email and you can do it right in outlook, then you know in code there is a way to setup a follow up to an e-mail.

This applies for everything in outlook. The only thing you cannot do is change where the email is coming from. Meaning you cannot mask the name of an email. The only thing you can do is
use the 'SendOnBehalfProperty', and this only works if you are a delegate of the original email sender.

Don't worry in time you all will be much better than me. All MS object models are very simple to use. I've gone through the project, excel, outlook, and word models. I've never done much with the Powerpoint object model, but Im sure it works the same way.

Jon
 
chewy said:
mission,

Where do you find those commands like

EmailSend.ReadReceiptRequested=True 'receipt request


I mean where do you look for references or do you just remember everything off the top of you head?



You can get some strong hints as well by creating the object, running it step by step through VB and adding a watch for the entire object. You can see a list of all the object properties and their current values.
 
So how do you learn what commands are available to use and where do you look?
 
Trial and Error...

What you see is what you get basically.

You see a property like 'SendOnBehalfOf'..that in itself should tell you what it does. Or you see something like ReadRecieptRequest..right there its all plain ol English.

.Send 'Sends
.Save 'Saves
.Reciepients 'stores reciepients
.Attachement 'attachements
.CC 'carbon copy
.Forward 'forward
.BCC 'blind carbon copy
.Priority 'sets a priority
.FollowUp 'sets a follow up
....
and the list goes on and on and on

Jon
 
...but where do you find those names?
 
Intellisense

You've seen it in code when you describe an object and then put a period after it (e.g Me. then a list follows) the properties all appear that are relevant.
 
cool thanks Ill take a look!
 
I will be changing jobs in a few weeks which could in turn result in me using more sophisicated databases. I will have to pull data from other packages other than Access, using SQL. I will be using Crystal Reports. So hopefully the knowledge I learned here will help me in my future endeavors.

Any good references on SQL?
 
Wow that looks awesome! thanks soooo much for all your help and everyone else help on every project you have helped me on.:)
 
Congrats chewy...you'll do fine.

You're hanging with the hardcore people now. INNER Joins :), Crystal Reports, VB, Outlook, maybe C++...

who knows, maybe the next Gates.

Jon
 

Users who are viewing this thread

Back
Top Bottom