Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Snding Meeting confimation from Access2k2 to Outlook 1

Status
Not open for further replies.

jbpelletier

Programmer
Sep 8, 2001
232
CA
'I know that:
'this can send an email via acces to outlook without
'asking for a confirmation. the code use OSSMTP.DLL
'driver

Option Compare Database
Option Explicit

Public Sub testSendMail()
Dim oSMTP As OSSMTP.SMTPSession

On Error Resume Next

Set oSMTP = CreateObject("OSSMTP.SMTPSession")

oSMTP.Server = "server.name.something"
oSMTP.MailFrom = "MyEmail@something.com"
oSMTP.SendTo = "YourEmail@something.com"
oSMTP.MessageSubject = "test"
oSMTP.MessageText = "Hello"
' oSMTP.Attachments.Add "path off the file"
oSMTP.SendEmail

If Err.Number <> 0 Then
Debug.Print &quot;Error &quot; & Err.Number & &quot;: &quot; & Err.Description
Else
Debug.Print &quot;Success&quot;
End If

End Sub

'question:
'Is it also possible to send via acces thing like &quot;meeting confirmation&quot;, &quot;note&quot; (little yellow paper), &quot;task&quot;, etc too outlook (to an other person on the intra-net) ? if yes.. can u provide me a link or a code sample.
tanx
jb
 
Hello,
You might want to try the 'outlook' object. First add the 'microsoft outlook object library' to your references and then you can start using code as in the example below.

Code:
Dim objOutlook As Outlook.Application
Dim objOutlooknote As Outlook.NoteItem

Set objOutlook = CreateObject(&quot;Outlook.Application&quot;)
Set objOutlooknote = objOutlook.CreateItem(olNoteItem)

objOutlooknote.Body = &quot;testbody&quot;
objOutlooknote.Save

This also works for mailitems, calenderitems,...

Regards,

Bitbuster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top