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

Status
Not open for further replies.
D

Delnang

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
 
S

Sue Mosher [MVP]

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

"Delnang" <Delnang> wrote in message

news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> 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

>
 
D

Delnang

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

> "Delnang" <Delnang> wrote in message
> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> >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
> >


>
 
S

Sue Mosher [MVP]

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

"Delnang" <Delnang> wrote in message

news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> 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" <Delnang> wrote in message
> > news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> > >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
> >> >

>

>
>>
 
D

Delnang

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

> "Delnang" <Delnang> wrote in message
> news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> > 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" <Delnang> wrote in message
> >> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> >> >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
> >> >> >
> >
> >>


>
 
S

Sue Mosher [MVP]

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

"Delnang" <Delnang> wrote in message

news:F9918A37-3600-484D-98D2-64E06206B0E6@microsoft.com...
> 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.
 
D

Delnang

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
> > > > > > > > "Delnang" <Delnang> wrote in message
> > news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> > > 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" <Delnang> wrote in message
> > >> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> > >> >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
> > >> > >> > >
> > >
> > >>

> >
 
S

Sue Mosher [MVP]

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

"Delnang" <Delnang> wrote in message

news:2977D610-D1F0-4285-A23C-FD95B0345197@microsoft.com...
> 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" <Delnang> wrote in message
> > > news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> > > > 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" <Delnang> wrote in message
> > > >> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> > > >> >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.
 
D

Delnang

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

> "Delnang" <Delnang> wrote in message
> news:2977D610-D1F0-4285-A23C-FD95B0345197@microsoft.com...
> >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" <Delnang> wrote in message
> >> > news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> >> > > 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" <Delnang> wrote in message
> >> > >> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> >> > >> >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.


>
 
D

Delnang

We are in testing now. The button for which I added the code:

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

runs for me, but doesn't seem to run for anyone else. What could I have

done wrong?

Angie

"Delnang" wrote:


> 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
> > > > > > > > "Delnang" <Delnang> wrote in message
> > news:2977D610-D1F0-4285-A23C-FD95B0345197@microsoft.com...
> > >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" <Delnang> wrote in message
> > >> > news:2FBAA29F-0490-482C-96DC-5978B5A9A9C0@microsoft.com...
> > >> > > 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" <Delnang> wrote in message
> > >> > >> news:B504C3A2-AEBE-446D-BA15-644EC6612206@microsoft.com...
> > >> > >> >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.

> >
 
D

Delnang

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

>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
S Problem running Command button code Outlook VBA and Custom Forms 2
S Code behind form command button Using Outlook 2
S HELP: How do I code a button I created? Outlook VBA and Custom Forms 1
B Write code for a button on New Form Outlook VBA and Custom Forms 1
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10
D VBA code to select a signature from the signatures list Outlook VBA and Custom Forms 3
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
P Color Code or highlight folders in Outlook 2016 Using Outlook 2
N Please advise code received new mail Using Outlook 0
B Outlook 2016 Unable to view images or logos on the outlook 2016 emails the same html code works well when i use outlook 2010 Using Outlook 0
S Excel vba code to manage outlook web app Using Outlook 10
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
S Skype for business meeting vba code Outlook VBA and Custom Forms 1
R Expand VBA Permanent Delete Code Outlook VBA and Custom Forms 6
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
A VBA Code in Outlook disappears after first use Outlook VBA and Custom Forms 1
Alex Cotton "invalid or unqualified reference" on code that should work Outlook VBA and Custom Forms 5
F VBA to ensure a code is entered in Subject title Outlook VBA and Custom Forms 1
Z Outlook Custom Form: Adding Dropdown(Project Code) at the end of subject Outlook VBA and Custom Forms 0
D Any updates or fixes that would make this code stop working just moving emails to another folder Outlook VBA and Custom Forms 1
N Open & Save VBAProject.Otm using VBA Code Outlook VBA and Custom Forms 1
M error code 0x8DE00006 Using Outlook 1
R VBA Code to permanently delete selected email Outlook VBA and Custom Forms 10
dyny723 Outlook 2016: Code to link a contact to emails received from that contact Outlook VBA and Custom Forms 1
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
J Custom form code doesn't run Outlook VBA and Custom Forms 2
M code to move selected Outlook contacts to another folder Using Outlook 3
E Outlook Form - Voting Responses Not Auto Processing If Form Contains Any Code Outlook VBA and Custom Forms 0
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
C Color Code New Calendar Items Using Outlook 2
S VBA Code to move mail items from search folder to inbox subfolder Outlook VBA and Custom Forms 4
B Automation error running VB macro code Outlook VBA and Custom Forms 8
S my vbscript button1_click code works on appointment created but not on opening an existing apntmn Outlook VBA and Custom Forms 16
M regarding the Create Contacts From Messages code Using Outlook 8
J Outlook 2010 VBScript editor does not run code at all Outlook VBA and Custom Forms 0
B VBA Code to create appointment from email Outlook VBA and Custom Forms 1
D VBA Code to strip Subject Line when replying or forwarding Using Outlook 3
L Outlook 2007 Contact Form Code Not Working Using Outlook 20
S The attempted operation failed ... 2nd time running code Outlook VBA and Custom Forms 3
A Check for attachment code not working Outlook VBA and Custom Forms 1
A Code to automatically delete message after sending Outlook VBA and Custom Forms 6
T What code to use to move the custom field values to message body when sending e-mail ? Outlook VBA and Custom Forms 8
G Annoying page of code when receiving Using Outlook 14

Similar threads

Top