PC Review


Reply
Thread Tools Rate Thread

Code Button to Copy Standard Text in Memo (message) Field

 
 
Delnang
Guest
Posts: n/a
 
      18th Sep 2009
I am looking for the code I could use behind a macro button that would
basically copy a sentence or two into the message (memo) field.

What I am hoping for is that I send a form to an employee... if they agree
with the content, they can click a button which would then paste a standard
statement "I agree to the above terms and conditions" to the mail message.

Thank you in advance,
Angie


 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      18th Sep 2009
Are you able to publish forms to the Organizational Forms library on your
company's Exchange server? If not, then this project is not feasible. If so,
then please provide information about the Outlook version and whether these
would be plain text, HTML, or RTF format messages?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Delnang" <(E-Mail Removed)> wrote in message
news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
>I am looking for the code I could use behind a macro button that would
> basically copy a sentence or two into the message (memo) field.
>
> What I am hoping for is that I send a form to an employee... if they agree
> with the content, they can click a button which would then paste a
> standard
> statement "I agree to the above terms and conditions" to the mail message.
>
> Thank you in advance,
> Angie
>
>



 
Reply With Quote
 
Delnang
Guest
Posts: n/a
 
      18th Sep 2009
Sue,
Thank you for your response. Yes, I am able to publish these forms to the
Organizational Forms library on our company's Exchange server. We are using
Outlook 2003. The message format type would be determined by the users
default which means it could be any of these three.

Thanks,
Angie

"Sue Mosher [MVP]" wrote:

> Are you able to publish forms to the Organizational Forms library on your
> company's Exchange server? If not, then this project is not feasible. If so,
> then please provide information about the Outlook version and whether these
> would be plain text, HTML, or RTF format messages?
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Delnang" <(E-Mail Removed)> wrote in message
> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
> >I am looking for the code I could use behind a macro button that would
> > basically copy a sentence or two into the message (memo) field.
> >
> > What I am hoping for is that I send a form to an employee... if they agree
> > with the content, they can click a button which would then paste a
> > standard
> > statement "I agree to the above terms and conditions" to the mail message.
> >
> > Thank you in advance,
> > Angie
> >
> >

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      18th Sep 2009
Is Word the email editor? Or the native Outlook editor? Do you care if the
formatting is flattened if the message format is RTF?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Delnang" <(E-Mail Removed)> wrote in message
news:2FBAA29F-0490-482C-96DC-(E-Mail Removed)...
> Sue,
> Thank you for your response. Yes, I am able to publish these forms to the
> Organizational Forms library on our company's Exchange server. We are
> using
> Outlook 2003. The message format type would be determined by the users
> default which means it could be any of these three.
>
> Thanks,
> Angie
>
> "Sue Mosher [MVP]" wrote:
>
>> Are you able to publish forms to the Organizational Forms library on your
>> company's Exchange server? If not, then this project is not feasible. If
>> so,
>> then please provide information about the Outlook version and whether
>> these
>> would be plain text, HTML, or RTF format messages?
>>
>> "Delnang" <(E-Mail Removed)> wrote in message
>> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
>> >I am looking for the code I could use behind a macro button that would
>> > basically copy a sentence or two into the message (memo) field.
>> >
>> > What I am hoping for is that I send a form to an employee... if they
>> > agree
>> > with the content, they can click a button which would then paste a
>> > standard
>> > statement "I agree to the above terms and conditions" to the mail
>> > message.
>> >
>> > Thank you in advance,
>> > Angie
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
Delnang
Guest
Posts: n/a
 
      18th Sep 2009
The email editor choice is set by the user. The text copied in can be flat
rtf text...no bells and whistles.
Thank you,
Angie

"Sue Mosher [MVP]" wrote:

> Is Word the email editor? Or the native Outlook editor? Do you care if the
> formatting is flattened if the message format is RTF?
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Delnang" <(E-Mail Removed)> wrote in message
> news:2FBAA29F-0490-482C-96DC-(E-Mail Removed)...
> > Sue,
> > Thank you for your response. Yes, I am able to publish these forms to the
> > Organizational Forms library on our company's Exchange server. We are
> > using
> > Outlook 2003. The message format type would be determined by the users
> > default which means it could be any of these three.
> >
> > Thanks,
> > Angie
> >
> > "Sue Mosher [MVP]" wrote:
> >
> >> Are you able to publish forms to the Organizational Forms library on your
> >> company's Exchange server? If not, then this project is not feasible. If
> >> so,
> >> then please provide information about the Outlook version and whether
> >> these
> >> would be plain text, HTML, or RTF format messages?
> >>
> >> "Delnang" <(E-Mail Removed)> wrote in message
> >> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
> >> >I am looking for the code I could use behind a macro button that would
> >> > basically copy a sentence or two into the message (memo) field.
> >> >
> >> > What I am hoping for is that I send a form to an employee... if they
> >> > agree
> >> > with the content, they can click a button which would then paste a
> >> > standard
> >> > statement "I agree to the above terms and conditions" to the mail
> >> > message.
> >> >
> >> > Thank you in advance,
> >> > Angie
> >> >
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      18th Sep 2009
With all those details, we can now talk about a solution. If you want to
append text to the end, just concatenate the new text with the existing Body
property:

Item.Body = Item.Body & vbCrLf & "new stuff"

If you want the text inserted somewhere in the middle, I would put a
placeholder token there, something like %sig% or another string that won't
be mistaken for text. You can then use the Replace() function to replace
that text in the Body or HTMLBody property, as appropriate.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Delnang" <(E-Mail Removed)> wrote in message
news:F9918A37-3600-484D-98D2-(E-Mail Removed)...
> The email editor choice is set by the user. The text copied in can be
> flat
> rtf text...no bells and whistles.


>> > Thank you for your response. Yes, I am able to publish these forms to
>> > the
>> > Organizational Forms library on our company's Exchange server. We are
>> > using
>> > Outlook 2003. The message format type would be determined by the users
>> > default which means it could be any of these three.
>> >
>> >> >I am looking for the code I could use behind a macro button that
>> >> >would
>> >> > basically copy a sentence or two into the message (memo) field.
>> >> >
>> >> > What I am hoping for is that I send a form to an employee... if they
>> >> > agree
>> >> > with the content, they can click a button which would then paste a
>> >> > standard
>> >> > statement "I agree to the above terms and conditions" to the mail
>> >> > message.



 
Reply With Quote
 
Delnang
Guest
Posts: n/a
 
      18th Sep 2009

I need just a little more help with the code. Will this be written like:

Function (Acknowledgement)
Item.Body = Item.Body & vbCrLf & "new stuff"
End Function

I do not know all the code to make it work. I added this code to a button
and it gives an error in line 1.

Thanks for hanging in with me.

Angie
"Delnang" wrote:

> The email editor choice is set by the user. The text copied in can be flat
> rtf text...no bells and whistles.
> Thank you,
> Angie
>
> "Sue Mosher [MVP]" wrote:
>
> > Is Word the email editor? Or the native Outlook editor? Do you care if the
> > formatting is flattened if the message format is RTF?
> > --
> > Sue Mosher, Outlook MVP
> > Author of Microsoft Outlook 2007 Programming:
> > Jumpstart for Power Users and Administrators
> > http://www.outlookcode.com/article.aspx?id=54
> >
> >
> > "Delnang" <(E-Mail Removed)> wrote in message
> > news:2FBAA29F-0490-482C-96DC-(E-Mail Removed)...
> > > Sue,
> > > Thank you for your response. Yes, I am able to publish these forms to the
> > > Organizational Forms library on our company's Exchange server. We are
> > > using
> > > Outlook 2003. The message format type would be determined by the users
> > > default which means it could be any of these three.
> > >
> > > Thanks,
> > > Angie
> > >
> > > "Sue Mosher [MVP]" wrote:
> > >
> > >> Are you able to publish forms to the Organizational Forms library on your
> > >> company's Exchange server? If not, then this project is not feasible. If
> > >> so,
> > >> then please provide information about the Outlook version and whether
> > >> these
> > >> would be plain text, HTML, or RTF format messages?
> > >>
> > >> "Delnang" <(E-Mail Removed)> wrote in message
> > >> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
> > >> >I am looking for the code I could use behind a macro button that would
> > >> > basically copy a sentence or two into the message (memo) field.
> > >> >
> > >> > What I am hoping for is that I send a form to an employee... if they
> > >> > agree
> > >> > with the content, they can click a button which would then paste a
> > >> > standard
> > >> > statement "I agree to the above terms and conditions" to the mail
> > >> > message.
> > >> >
> > >> > Thank you in advance,
> > >> > Angie
> > >> >
> > >> >
> > >>
> > >>
> > >>

> >
> >
> >

 
Reply With Quote
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      18th Sep 2009

Parentheses are used to enclose arguments. Therefore, your function has no
name. And in fact, you don't want a function at all, because you're not
returning a value. See http://www.outlookcode.com/article.aspx?ID=38 for an
example of the Click event handler for a button on a form, which is what
you're creating, right?

Note that this is not a VBA macro, but VBScript code behind the form.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Delnang" <(E-Mail Removed)> wrote in message
news:2977D610-D1F0-4285-A23C-(E-Mail Removed)...
>I need just a little more help with the code. Will this be written like:
>
> Function (Acknowledgement)
> Item.Body = Item.Body & vbCrLf & "new stuff"
> End Function
>
> I do not know all the code to make it work. I added this code to a
> button
> and it gives an error in line 1.
>
>
>> The email editor choice is set by the user. The text copied in can be
>> flat
>> rtf text...no bells and whistles.
>> Thank you,
>> Angie
>>
>> "Sue Mosher [MVP]" wrote:
>>
>> > Is Word the email editor? Or the native Outlook editor? Do you care if
>> > the
>> > formatting is flattened if the message format is RTF?
>> >
>> > "Delnang" <(E-Mail Removed)> wrote in message
>> > news:2FBAA29F-0490-482C-96DC-(E-Mail Removed)...
>> > > Sue,
>> > > Thank you for your response. Yes, I am able to publish these forms
>> > > to the
>> > > Organizational Forms library on our company's Exchange server. We
>> > > are
>> > > using
>> > > Outlook 2003. The message format type would be determined by the
>> > > users
>> > > default which means it could be any of these three.
>> > >
>> > > Thanks,
>> > > Angie
>> > >
>> > > "Sue Mosher [MVP]" wrote:
>> > >
>> > >> Are you able to publish forms to the Organizational Forms library on
>> > >> your
>> > >> company's Exchange server? If not, then this project is not
>> > >> feasible. If
>> > >> so,
>> > >> then please provide information about the Outlook version and
>> > >> whether
>> > >> these
>> > >> would be plain text, HTML, or RTF format messages?
>> > >>
>> > >> "Delnang" <(E-Mail Removed)> wrote in message
>> > >> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
>> > >> >I am looking for the code I could use behind a macro button that
>> > >> >would
>> > >> > basically copy a sentence or two into the message (memo) field.
>> > >> >
>> > >> > What I am hoping for is that I send a form to an employee... if
>> > >> > they
>> > >> > agree
>> > >> > with the content, they can click a button which would then paste a
>> > >> > standard
>> > >> > statement "I agree to the above terms and conditions" to the mail
>> > >> > message.



 
Reply With Quote
 
Delnang
Guest
Posts: n/a
 
      21st Sep 2009
Great, thank you for all your help.

Angie

"Sue Mosher [MVP]" wrote:

> Parentheses are used to enclose arguments. Therefore, your function has no
> name. And in fact, you don't want a function at all, because you're not
> returning a value. See http://www.outlookcode.com/article.aspx?ID=38 for an
> example of the Click event handler for a button on a form, which is what
> you're creating, right?
>
> Note that this is not a VBA macro, but VBScript code behind the form.
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Delnang" <(E-Mail Removed)> wrote in message
> news:2977D610-D1F0-4285-A23C-(E-Mail Removed)...
> >I need just a little more help with the code. Will this be written like:
> >
> > Function (Acknowledgement)
> > Item.Body = Item.Body & vbCrLf & "new stuff"
> > End Function
> >
> > I do not know all the code to make it work. I added this code to a
> > button
> > and it gives an error in line 1.
> >
> >
> >> The email editor choice is set by the user. The text copied in can be
> >> flat
> >> rtf text...no bells and whistles.
> >> Thank you,
> >> Angie
> >>
> >> "Sue Mosher [MVP]" wrote:
> >>
> >> > Is Word the email editor? Or the native Outlook editor? Do you care if
> >> > the
> >> > formatting is flattened if the message format is RTF?
> >> >
> >> > "Delnang" <(E-Mail Removed)> wrote in message
> >> > news:2FBAA29F-0490-482C-96DC-(E-Mail Removed)...
> >> > > Sue,
> >> > > Thank you for your response. Yes, I am able to publish these forms
> >> > > to the
> >> > > Organizational Forms library on our company's Exchange server. We
> >> > > are
> >> > > using
> >> > > Outlook 2003. The message format type would be determined by the
> >> > > users
> >> > > default which means it could be any of these three.
> >> > >
> >> > > Thanks,
> >> > > Angie
> >> > >
> >> > > "Sue Mosher [MVP]" wrote:
> >> > >
> >> > >> Are you able to publish forms to the Organizational Forms library on
> >> > >> your
> >> > >> company's Exchange server? If not, then this project is not
> >> > >> feasible. If
> >> > >> so,
> >> > >> then please provide information about the Outlook version and
> >> > >> whether
> >> > >> these
> >> > >> would be plain text, HTML, or RTF format messages?
> >> > >>
> >> > >> "Delnang" <(E-Mail Removed)> wrote in message
> >> > >> news:B504C3A2-AEBE-446D-BA15-(E-Mail Removed)...
> >> > >> >I am looking for the code I could use behind a macro button that
> >> > >> >would
> >> > >> > basically copy a sentence or two into the message (memo) field.
> >> > >> >
> >> > >> > What I am hoping for is that I send a form to an employee... if
> >> > >> > they
> >> > >> > agree
> >> > >> > with the content, they can click a button which would then paste a
> >> > >> > standard
> >> > >> > statement "I agree to the above terms and conditions" to the mail
> >> > >> > message.

>
>
>

 
Reply With Quote
 
Delnang
Guest
Posts: n/a
 
      17th Dec 2009
The code buttons are working fine where the buttons enter text in the memo
field. However...When the user Forwards a message which has an attachment
and the next user receives it and clicks Forward...the attachment field does
not display. The attachment is still there, but it doesn't display. Is
there a way to display the attachment field?
Angie

"Delnang" wrote:

> I am looking for the code I could use behind a macro button that would
> basically copy a sentence or two into the message (memo) field.
>
> What I am hoping for is that I send a form to an employee... if they agree
> with the content, they can click a button which would then paste a standard
> statement "I agree to the above terms and conditions" to the mail message.
>
> Thank you in advance,
> Angie
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting text, memo field. Code sample works, But can it be mo BrianPaul Microsoft Access 0 12th Jul 2009 08:59 PM
Memo Field - Append Text fields into memo field??? =?Utf-8?B?UGF0IFN0ZXdhcnQ=?= Microsoft Access 1 18th Feb 2007 08:45 PM
trouble concatenating text of 1 memo field to another memo field in same record via button ghadley_00@yahoo.com Microsoft Access Form Coding 1 9th Nov 2005 11:55 AM
DISTINCT in code truncates a memo field to a text (255 characters) =?Utf-8?B?ZGhlbmRlcjA5?= Microsoft Access Reports 1 22nd Dec 2004 09:26 PM
Click a button and send a text phrase to a memo field =?Utf-8?B?UE1L?= Microsoft Access Getting Started 4 25th May 2004 02:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:15 PM.