Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-03-2002, 01:38 AM   #1
Hazmataz
Guest
 
Posts: n/a
SendObject Good but not that Good...

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

  Reply With Quote
Old 11-04-2002, 05:53 AM   #2
CBragg
VB Dummy
 
CBragg's Avatar
 
Join Date: Oct 2002
Location: UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
CBragg
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 is offline   Reply With Quote
Old 11-13-2002, 06:50 AM   #3
Rob.Mills
Registered User
 
Join Date: Aug 2002
Location: Raleigh, NC USA
Posts: 871
Thanks: 0
Thanked 1 Time in 1 Post
Rob.Mills
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

Rob.Mills is offline   Reply With Quote
Old 11-13-2002, 06:58 AM   #4
Fizzio
Chief Torturer
 
Fizzio's Avatar
 
Join Date: Feb 2002
Location: Newcastle-upon-Tyne, UK
Posts: 1,885
Thanks: 0
Thanked 2 Times in 2 Posts
Fizzio
Should be vbCrLf (Carriage Return, Line Feed - equivalent to Chr(13) & Chr(10))
Fizzio is offline   Reply With Quote
Old 11-13-2002, 07:02 AM   #5
Rob.Mills
Registered User
 
Join Date: Aug 2002
Location: Raleigh, NC USA
Posts: 871
Thanks: 0
Thanked 1 Time in 1 Post
Rob.Mills
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))
Rob.Mills is offline   Reply With Quote
Old 11-13-2002, 07:14 AM   #6
Fizzio
Chief Torturer
 
Fizzio's Avatar
 
Join Date: Feb 2002
Location: Newcastle-upon-Tyne, UK
Posts: 1,885
Thanks: 0
Thanked 2 Times in 2 Posts
Fizzio
Nope just
strmsg = str1 & vbCrLf

the bracketed text was just me trying to be a smart arse, explaining why vbCrLf and not vbClRf
Fizzio is offline   Reply With Quote
Old 11-13-2002, 07:18 AM   #7
Rob.Mills
Registered User
 
Join Date: Aug 2002
Location: Raleigh, NC USA
Posts: 871
Thanks: 0
Thanked 1 Time in 1 Post
Rob.Mills
Ahhh. Now I get it. Didn't notice the correction in spelling on the first one.

Thanks

Rob.Mills is offline   Reply With Quote
Old 11-13-2002, 07:30 AM   #8
CBragg
VB Dummy
 
CBragg's Avatar
 
Join Date: Oct 2002
Location: UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
CBragg
Sorry Rob, i meant vbCrLf just a mistype.

CBragg is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 05:43 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World