Script only runs on my PC

D

Delnang

I have code behind a command button:
Example:

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

and when I select the command button it works on my PC. When I send the
email, and the recipient clicks the button, nothing happens.

How can I make it so the button work so that if one were to get the form
from the Org. Library, the command buttons run the code?

Thanks,
Angie
 
S

Sue Mosher [MVP]

The form must be published to the Organizational Forms library with the
"send form definition with item" box on the (Properties) page in the
designer unchecked.
 
D

Delnang

Yes, that worked like a charm. I knew it would be easy.

Two addtional questions:
1. Is there a way to add an =now() type statement to this so that one would
know when the text was added to an email?

2. Is there a way to surpress automatic signatures in an Outlook form?

Thanks,
Angie
 
S

Sue Mosher [MVP]

1) Yes, Now() is the correct function. Concatenate with to your existing
expression used to set Item.Body.

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

Delnang

Thank you! What great knowledge.

1) What would the code look like? I am not very well versed. I get
confused as to where () and "" go.
Item.Body = Item.Body & vbCrLf & "concat(=now(),"new stuff")"
??? something like that?

2) Outlook 2003 SP3 for questions: Is there a way to surpress automatic
signatures in an Outlook form?

Thank you,
Angie
 
D

Delnang

Again, Thank you!

One last question? Approx. 95% of our users have signatures. How do you go
about getting that custom code to appear above one's signature. Right now,
it is appearing below it.

Thanks,
Angie
 
D

Delnang

Sorry, I got lost by that. Here is my code:

Sub Employee_Signature_Click()
Item.Body = Item.Body & vbCrLf & Now()
Item.Body = Item.Body & vbCrLf & "I have read the document."
End Sub

What would be rearranged so the date/time and text appear above the signature?

Thanks,
Angie
 
S

Sue Mosher [MVP]

This is so very, very basic that you need to learn it, so I'm not going to
give you the answer, only hints. You already seem to know that you can
combine content strings with the & operator. What happens if you change the
order of the terms separated by & in your code below?

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

Delnang

Yes, got it. Thanks!

Sue Mosher said:
This is so very, very basic that you need to learn it, so I'm not going to
give you the answer, only hints. You already seem to know that you can
combine content strings with the & operator. What happens if you change the
order of the terms separated by & in your code below?

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

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