By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

How to send a mail automatically?

P: 16
I know how to create an outlook object. this is the function I wrote:
Expand|Select|Wrap|Line Numbers
  1. Public Sub Outlook_CreateNew(prmOutLookType As Integer, Optional prmEmailAdress As String, Optional prmMessage As String)
  2.     Dim objOL As Object
  3.     Set objOL = CreateObject("Outlook.Application")
  4.     Dim NewTask As Object
  5.     Set NewTask = objOL.CreateItem(prmOutLookType)
  6.     If prmOutLookType = 0 Then 'Mail
  7.         NewTask.To = prmEmailAdress
  8.         NewTask.Body = prmMessage
  9.     End If
  10.     NewTask.Display
  11. End Sub
If anybody can answer me:
1.How can I do that the computer also will send the mail automatically by Button event without opening the outlook?
2. How can I find the outlook properties, it was a miracle I found out that "obj.Body" is the body text, I just gussed, the problem is it don't give like intelisence.
Mar 14 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,347
  1. Try DoCmd.SendObject()
  2. Use F2 to go to the Object Browser Pane. Navigate from there into the Outlook library reference etc.
Mar 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.