What line does the debugger hit?
Try changing the Set olApp line to:
Set olApp = CreateObject("Outlook.Application")
What line does the debugger hit?
Try changing the Set olApp line to:
Set olApp = CreateObject("Outlook.Application")
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.
This error pops up after launching Outlook
Np, thanks again June, your corrections worked!
But what line is the debugger highlighting? Did you try the suggested code edit?
Is this code behind form?
You call the sub CreateHTMLMail but I don't see any HTML in this procedure. HTML code tags would be used to create an HTML formatted body. HTML tags can apply formatting for bold, underscore, font, tabulated, etc.
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.
Thats my fault, I stripped the code down for this user. In my application all mail variables are determined by html on a webpage. I am pretty sure he wants to be able to fill out everything in this email from form text boxes... Maybe he can post mdb? I'd take a look at it .
I guess we are at the point will have to analyze db directly, because don't see anything else that would be an issue in the code.
Follow instructions at bottom of my post to provide db.
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.
Here is a simple database with one table and one form. I want to send email if i click on the button Send Email on the form. Please help.
Reference the form name, not Detail section:
.Subject = Forms("Orders").EmailSubject
.Body = Forms("Orders").EmailMessage
.To = Forms("Orders").EmailTo
OR
.Subject = Me.EmailSubject
.Body = Me.EmailMessage
.To = Me.EmailTo
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.
Still same issue. runtime error 438 "Object does not support this property or method". I have attached the database, can you please make it work in that?
Misspelling, missing 'e':
Set objMail = olApp.CreateItem(olMailItem)
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.
It works perfectly. Thank you very much guys.