Access 2007 Macros - SendObject action, Message Text action argume

  • Thread starter Thread starter rgille
  • Start date Start date
R

rgille

I am trying to learn about Access 2007 macros. I downloaded the Call Tracker
template from Microsoft.com. The Call Details form in this template has an
E-mail button which, when clicked, dumps the contents of the form’s
Description field into the body of the e-mail. The E-mail button runs an
embedded macro On Click. Looking at the properties of the embedded macro’s
SendObject action, the Message Text action argument looks like this:
=IIf([Form].[Description].[TextFormat]=1,PlainText([Description]),[Description])
I want to include the form’s Comments field in the Message Text too, so
that the email message will include the Comments field contents followed by
the Description field contents (if possible I would like these on separate
lines). Can anyone point me in the right direction to do this? Thank you.
 
Rgille,

Without looking at the actual template you are using for your example, I
guess it is likely to be like this...

=IIf([Form].[Description].[TextFormat]=1,PlainText([Comments] & Chr(13) &
Chr(10) & [Description]),[Comments] & Chr(13) & Chr(10) & [Description])
 
Steve - Thank you, that worked! One question: Is there way to automatically
insert a "carriage return" (blank line) between the Comments text and the
Description text in the generated e-mail? Thanks again. - Bob

Steve Schapel said:
Rgille,

Without looking at the actual template you are using for your example, I
guess it is likely to be like this...

=IIf([Form].[Description].[TextFormat]=1,PlainText([Comments] & Chr(13) &
Chr(10) & [Description]),[Comments] & Chr(13) & Chr(10) & [Description])

--
Steve Schapel, Microsoft Access MVP


rgille said:
I am trying to learn about Access 2007 macros. I downloaded the Call
Tracker
template from Microsoft.com. The Call Details form in this template has
an
E-mail button which, when clicked, dumps the contents of the form’s
Description field into the body of the e-mail. The E-mail button runs an
embedded macro On Click. Looking at the properties of the embedded macro’s
SendObject action, the Message Text action argument looks like this:
=IIf([Form].[Description].[TextFormat]=1,PlainText([Description]),[Description])
I want to include the form’s Comments field in the Message Text too, so
that the email message will include the Comments field contents followed
by
the Description field contents (if possible I would like these on separate
lines). Can anyone point me in the right direction to do this? Thank
you.
 
Rgille,

Chr(13) & Chr(10) takes you to a new line. To insert a blank line, just
repeat...

[Comments] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [Description]
 
Many thanks Steve. - Bob

Steve Schapel said:
Rgille,

Chr(13) & Chr(10) takes you to a new line. To insert a blank line, just
repeat...

[Comments] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [Description]

--
Steve Schapel, Microsoft Access MVP


rgille said:
Steve - Thank you, that worked! One question: Is there way to
automatically
insert a "carriage return" (blank line) between the Comments text and the
Description text in the generated e-mail? Thanks again. - Bob
 
If you wanted to lable these feilds in the email how would you do so?

Steve Schapel said:
Rgille,

Chr(13) & Chr(10) takes you to a new line. To insert a blank line, just
repeat...

[Comments] & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [Description]

--
Steve Schapel, Microsoft Access MVP


rgille said:
Steve - Thank you, that worked! One question: Is there way to
automatically
insert a "carriage return" (blank line) between the Comments text and the
Description text in the generated e-mail? Thanks again. - Bob
 
Hi Steve,
I found this thread very useful. Firstly, thanks for your help.

Now, just in addition to this: I would like to add free text.

I want to add comments and due date, but i would like to add free text in
the email which says "Comments" and "Due date" as headings.

Could you please help me with this?

Thanks
 
I too found this very helpful and I as well, need a little bit of guidance. In the expression: > =IIf([Form].[Description].[TextFormat]=1,PlainText([Comments] & Chr(13) &
Chr(10) & [Description]),[Comments] & Chr(13) & Chr(10) & [Description]),


I would like to add data from a table before the comments and description are inserted. The table name is "Atext" . The column name is "Phrase". the ID is 1

can you point me in the correct direction?
 
Back
Top