send to email

  • Thread starter Thread starter cmichaud
  • Start date Start date
C

cmichaud

I have a onclick event that will take values from my form then address
an email in outlook.

here is part of the code

Set MyMail = MyOutlook.CreateItem(olMailItem)
With MyMail
.To = MyAdd
.Subject = Subjectline
.Display 'use display and remove .Send if you want to
view the email before sending.
End With


I am looking to implant a text file as the body.
Do i just add

..body = location of file

?? I want to use the same file over again....just allow the user to
edit the file. thks
 
I saw this earlier and since you haven't had a reply yet I will offer
this twist on a solution, or another idea.

I use the "SendObject" method frequently. This allows you to hardcode
subject and messages, or gives you the option of letting the user add
their own message. If you are trying to e-mail the values of the
current form try this. Save your form as a report. Create a query to
base your report on that calls the same information as your form, but
specifies the current form. This way, your email will have attached
the information from the current form and the user can add their own
message before it is sent.
 
I am not sure what you mean by implant.

If by that you mean have a pre-defined message, you just need to create
a stringfield and load it with the message that you want to appear
there.

predefmsg = "This is the message that I want" & char(13) & _
"to include in the body of the email" & char(13) & _
char(13) & _
char(13) & _
"This is the last line of the text."

.body = predefmsg

=============================

If you want the message to be in html format then
predefmsg = "<body>This is the message that I want <bold>( this part
bolded)</bold> <br>" & _
"to include in the body of the email<br>" & _
"<br>" & _
"<br>" & _
"This is the last line of the text.</body>"


.bodyformat = 2
.htmlbody = predefmsg

==========================================

Ron
 
I was thinking that i could include a txt document saved elsewhere on
the computer in the body. Not sent as an attachment but just inserted
into the body.
 
It sounds as if you are trying to send a link to a document within the
body of the email.

Yes that can be done.

If you send the email to more than one person then they are all going
to be going to and trying to edit the same file - only one person at a
time and person 2 will see what person 1 put in earlier and can change
that information. And then if a second person opens it as read only
because it happens to be open by person 1 right now, but then saves it
back on top of the file AFTER person 1 gets out then you have lost
person 1's update.

And then what are you going to do with it. If they can edit it you
don't know who put in what.
If they can't edit it you have made it so it takes two steps to see
what it is and it is then identical to an attatched file

If you do include it as a link, you will want to use the UNC path
address not a letter mapping because they may not have the same drive
mappings.

In essence the body of the email can be text that you put in there like
the example I gave you or it can be a link which then has the possible
problems I have just mentioned.
 
gotcha. i think i will go with the old fashion way and let the user
enter the body of the email before the email is sent.
 
Back
Top