Attachment 14731
my references
Attachment 14731
my references
different systems, windows etc same resultCan you try on another computer, another system, home computer, work computer?
The code works for me. Am on home computer now.
Did you use an actual email address in your code? I send to myself.
I tested with and without (I was surprised this worked) library reference. With Outlook open or closed.
Couldn't I do a check first to see if the user has Outlook before running the code for the users without outlook to prevent errors?
I feel as though I am goofing things up. I definitely was and may still be confused about what you are trying to accomplish. If you want to send emails you can use CDO. If you need return receipt, I do not believe that will work with CDO. I will look for a schema though.
That leaves you with Outlook. If the machines are going to have different versions of Outlook, ie 2003, 2010, 2013, then use late binding.
I think it is possible to check if Outlook installed but might be easier just to trap the error with error handler.
Also, might find this interesting http://www.cpearson.com/Excel/EMail.aspx
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I feel as though I am goofing things up. I definitely was and may still be confused about what you are trying to accomplish. If you want to send emails you can use CDO. If you need return receipt, I do not believe that will work with CDO. I will look for a schema though.
That leaves you with Outlook. If the machines are going to have different versions of Outlook, ie 2003, 2010, 2013, then use late binding.
Yeah since I can't use CDO I will have to use outlook and just not reference the library for some of the users' front end - I can go back to trying to get outlook to work without the late binding as that doesn't seem to be working for me
The problem I see with CDOI think it is possible to check if Outlook installed but might be easier just to trap the error with error handler.
Also, might find this interesting http://www.cpearson.com/Excel/EMail.aspx
no read receipt
no sent box
If I was using it I would use CDO but the requirements set by management make CDO not an option
Then we are back to the mystery of why the code works for us but not you.
It's looking like error handler best way to deal with absence of Outlook.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Well, I got CDO to send a return receipt but if I use Bcc it will ask for two return receipts. This would be confusing to the user. I say Bcc, because there is no way for CDO to place the message in the sent folder. Of course, there probably is a way. I just don't know if it is worth it. Could be interresting to try though.
I have this working now,I think what you have will work. I tested the following and it worked for me. Remove the reference to Outlook Objects in your reference library thing before you run the code.
Code:Private Sub cmdTest_Click() Dim appOutLook As Object Dim MailOutLook As Object Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(0) With MailOutLook .BodyFormat = 2 .To = "Email@Domain.com" ''.cc = "" ''.bcc = "" .Subject = "Subject Line" .HTMLBody = "This is the body of the Email" .DeleteAfterSubmit = False 'This would let Outlook send the note without storing it in your sent bin .ReadReceiptRequested = True .send End With End Sub
I took out everything and am now working on the recordset
UPDATE: Infact I know why the error was happening and I will explain later
Dim appOutLook As Object
Dim MailOutLook As Object
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(0)
had to be placed just above the With MailOutlook
Did you see post #40 ?
Thank you to you both for help with this