Very basic DoCmd.Send Object help needed

antonyx

Arsenal Supporter
Local time
Today, 12:12
Joined
Jan 7, 2005
Messages
556
ok, i have been searching on google and the forums for sending forms/reports as outlook atachments.

all the examples i have seen are more complicated than my one.. i have one form.. and i just want to email those details.. in the form are the fields, one textbox where you put the email address, and one send email form button..

i got it working using a long module, that i didnt understand..and then i was told about the DoCmd.SendObject method which looks a lot easier..

i have one request, in the simple database i have uploaded, will someone show me where to put the code.. the db is VERY simple, and quick (one form with a send email button).. and if anyone can spare a few minutes to get this one working i will be very grateful..
 

Attachments

re:

Hi,
check the attachment...I threw something quick together for you.
Furthermore, keep in mind that Date...Time...Name...are Access reserved words and should NOT be used as control/field/object...names. Try to adapt some naming convension.
Also remember that the Sendobject method is very limited. It is only meant for interaction with MS outlook and can only send internal db objects as attachment and only one at a time. If any of that conflicts with what you are trying to achieve then you need to look for other automation code.
HTH
Good luck
 

Attachments

yes, that is just what i needed.. because i wont ever be sending many reports at once, and ill always just need to send a single set of details to a single email address.. .thank you very much sir.

just wondering..

is this: & _

a line break?? if it isnt, could you just tell me what a line break is.. and if i wanted an item to be bold how could i do that. one last thing aswell, i realise that not every email client receives html emails so im gonna keep it in rtf, but is there a way to set tabs..

eg.

at the moment it looks like this..

Job Id: 1
Name: job
Phone: 0666 666
Date: 06/06/2006
...

is there any way to tab that part of the email so it looks like it is in a table.. or is that not possible in rtf
 
re:

Hi,
unfortunately another limitation of the sendobject method is that it can only send plain text emails. So you can't send formatted emails in the manner you want. If you do want to achieve that then you need to use automation code to create an html message.
A good sample of that can be found here.
A new line in VBA is vbCrlf so you can use:

"First line..." & vbCrlf & "second line"

& _ is to break the line in code so that it doesn't have to be one long line of code and is structured better for the coder.
HTH
Good luck
 

Users who are viewing this thread

Back
Top Bottom