How do I post message in a body or addresses to the To: box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know how to send an e-mail using the SendObject function but it limits me
to 255 characters which is way less than I need. Any ideas?
 
Rich Selby said:
I know how to send an e-mail using the SendObject function but it
limits me to 255 characters which is way less than I need. Any ideas?

The message body is *not* limited to 255 characters. How are you trying
to do this, that makes you think it is? If you're storing the message
text in a table, in a Text field, that field size is limited to 255
characters. You'd need to use a Memo field instead.
 
I am storing my text in a memo field called "Letter". I have a form that that
displays this field "Letter". So in my macro -> SendObject -> "Message:"
line, to send the "Letter" in the body of Outlook, I type:
[Forms]![Formname]![Letter]. Outlook opens up and chops off the text after
255 characters. Am I doing something wrong? Thanks,
 
Do you have a format or input mask defined for the text box? If so, that's
probably the problem.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Rich Selby said:
I am storing my text in a memo field called "Letter". I have a form that that
displays this field "Letter". So in my macro -> SendObject -> "Message:"
line, to send the "Letter" in the body of Outlook, I type:
[Forms]![Formname]![Letter]. Outlook opens up and chops off the text after
255 characters. Am I doing something wrong? Thanks,

Dirk Goldgar said:
The message body is *not* limited to 255 characters. How are you trying
to do this, that makes you think it is? If you're storing the message
text in a table, in a Text field, that field size is limited to 255
characters. You'd need to use a Memo field instead.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
No formats or input mask. Are you saying you can send a long letter in the
body of an Outlook e-mail launched from MS Access and not as an attachment?
I've been trying this for months and cant get it to work. How would you go
about inserting text in a memo field into the body of an Outlook e-mail via
macro?

Douglas J Steele said:
Do you have a format or input mask defined for the text box? If so, that's
probably the problem.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Rich Selby said:
I am storing my text in a memo field called "Letter". I have a form that that
displays this field "Letter". So in my macro -> SendObject -> "Message:"
line, to send the "Letter" in the body of Outlook, I type:
[Forms]![Formname]![Letter]. Outlook opens up and chops off the text after
255 characters. Am I doing something wrong? Thanks,

Dirk Goldgar said:
I know how to send an e-mail using the SendObject function but it
limits me to 255 characters which is way less than I need. Any ideas?

The message body is *not* limited to 255 characters. How are you trying
to do this, that makes you think it is? If you're storing the message
text in a table, in a Text field, that field size is limited to 255
characters. You'd need to use a Memo field instead.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Douglas J Steele said:
Do you have a format or input mask defined for the text box? If so,
that's probably the problem.


Rich Selby said:
I am storing my text in a memo field called "Letter". I have a form
that that displays this field "Letter". So in my macro -> SendObject
-> "Message:" line, to send the "Letter" in the body of Outlook, I
type: [Forms]![Formname]![Letter]. Outlook opens up and chops off
the text after 255 characters. Am I doing something wrong? Thanks,

I think it may be a limitation of the SendObject macro action. Since
Rich didn't mention macros, I tested the DoCmd.SendObject method in VBA
code. I think the macro action has 255-byte limit, where VBA method
does not. Rich, you might consider rewriting your macro as a VBA event
procedure instead, and see if it works better.
 
Ooooh gotcha. That might just be it! I'll go try find the code somewhere to
to that. Do you have any good spots to find that kind of code. Thanks a lot
for all your help!!

Dirk Goldgar said:
Douglas J Steele said:
Do you have a format or input mask defined for the text box? If so,
that's probably the problem.


Rich Selby said:
I am storing my text in a memo field called "Letter". I have a form
that that displays this field "Letter". So in my macro -> SendObject
-> "Message:" line, to send the "Letter" in the body of Outlook, I
type: [Forms]![Formname]![Letter]. Outlook opens up and chops off
the text after 255 characters. Am I doing something wrong? Thanks,

I think it may be a limitation of the SendObject macro action. Since
Rich didn't mention macros, I tested the DoCmd.SendObject method in VBA
code. I think the macro action has 255-byte limit, where VBA method
does not. Rich, you might consider rewriting your macro as a VBA event
procedure instead, and see if it works better.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Rich Selby said:
Ooooh gotcha. That might just be it! I'll go try find the code
somewhere to to that. Do you have any good spots to find that kind of
code. Thanks a lot for all your help!!

Suppose you were sending this message from the Click event of a command
button named (for example) "cmdSend", on a form that also contains text
boxes named "Recipient", "Subject", and "Letter". The code for that
button's event procedure might look like this:

'----- start of example code -----
Private Sub cmdSend_Click()

DoCmd.SendObject _
To:=Me!Recipient, _
Subject:=Me!Subject, _
MessageText:=Me!Letter, _
EditMessage:=False

' Note: if you want to edit the message before sending,
' change "False" to "True" in the above.

End Sub
'----- end of example code -----

There's not much to it, really. You may want to add code to make sure
none of the text boxes is empty before sending the message.
 
Dirk, it worked! One more question, how would I add a field thats on another
form. Would I replace "Me!Letter" with "[Forms]![OtherForm]![Message]"?
Thanks again!
 
Rich Selby said:
Dirk, it worked! One more question, how would I add a field thats on
another form. Would I replace "Me!Letter" with
"[Forms]![OtherForm]![Message]"?

Exactly. Of course, that form must be open when you run the code.
Thanks again!

You're welcome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top