Access 2007 Macros - SendObject action, Message Text action argume

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.
 
S

Steve Schapel

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])
 
R

rgille

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.
 
S

Steve Schapel

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]
 
R

rgille

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
 
M

matt

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
 
S

Steve Schapel

I am not sure what you mean, Matt. Can you give an example of what you
want?
 
R

RamanVE

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
 

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

Top