SendObject Good but not that Good...

  • Thread starter Thread starter Hazmataz
  • Start date Start date
H

Hazmataz

Guest
Hi,

I am a newbie to Access and trying to improve the database at work. I have sussed out how to use SendObject to send the data I require BUT the computers are a bit slow (as are the ladies in accounts) and they don't want to use attachments. So can I send the information I want in THE BODY of the EMail (we use Outlook 98) not as an attachment?

We use Access 97

Thanks in advance

H
 
Start the code off like this. Please note though that in tools and references, check the Microsoft Outlook reference.

Dim NameSpace As Object
Dim EmailSend As Object
Dim EmailApp As Object

Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0) ' Mail Item

EmailSend.Subject = "Test Subject"
EmailSend.Body = "ENTER BODY TEXT HERE"
EmailSend.Recipients.Add "Name@hotmail.com"
EmailSend.Send

Note: If you want a new line in your code enter ' & vbclrf '


Have fun!!!
 
CBragg,

I am trying to generate an email an insert data. I came across this thread when I was trying to find out how to insert returns into the body message. You say you can use vbClRf to do this?

I've created a dummy function to try and make this work. Have a look, please. When I try to run it it says that 'vbClRf' is not defined. Am I doing this wrong?

Public Function Ret()

Dim str1 As String
Dim str2 As String
Dim strmsg As String

str1 = "This is a test."
str2 = "This is a test."
strmsg = str1 & vbClRf
strmsg = strmsg & str2

Debug.Print strmsg


End Function
 
Should be vbCrLf (Carriage Return, Line Feed - equivalent to Chr(13) & Chr(10))
 
Not sure I'm following you. Do you mean I should make my code this:

strmsg = str1 & vbCrLf (Carriage Return, Line Feed - equivalent to Chr(13) & Chr(10))
 
Nope just
strmsg = str1 & vbCrLf

the bracketed text was just me trying to be a smart arse, explaining why vbCrLf and not vbClRf :D
 
Ahhh. Now I get it. Didn't notice the correction in spelling on the first one.

Thanks
 

Users who are viewing this thread

Back
Top Bottom