HOT!! Help Needed - Outlook 2003 Forms

  • Thread starter Thread starter corey
  • Start date Start date
C

corey

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.

Corey
 
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey
 
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Corey
 
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

corey said:
Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey


The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.



--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey


The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

corey said:
Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue said:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.



--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey


The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue said:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

corey said:
Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey


CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue said:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey


CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

corey said:
Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Since a bound control displays the value of the property, do you have a
screenshot of something that shows this?

#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey


CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Shows what?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Since a bound control displays the value of the property, do you have a
screenshot of something that shows this?

#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

corey said:
My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey



Sue Mosher [MVP-Outlook] wrote:
CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
The bound control...
Shows what?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Since a bound control displays the value of the property, do you have a
screenshot of something that shows this?

#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey



Sue Mosher [MVP-Outlook] wrote:
CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Sue,
After research , I'm only running bound controls.
Corey


Shows what?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Since a bound control displays the value of the property, do you have a
screenshot of something that shows this?

#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey



Sue Mosher [MVP-Outlook] wrote:
CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
Sue,
Hopefully the final question. I've got the bound controls setup
correctly. I've got the scripting behind the form running like a
charm. I can pull up the message and enter the information and send
it. However, people on the receiving side cannot open it due to the
Microsoft Office Outlook error stating "Can't open this item. The
operation failed." I've deleted the frmcache.dat file as microsoft
requests and also have cleared my cache file. Restarted outlook in safe
mode. None of these options worked.
Shows what?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


corey said:
Since a bound control displays the value of the property, do you have a
screenshot of something that shows this?

#2: A bound control is one that is associated with an Outlook property. In other words, the control is bound to the property, so that the control displays the value of the property and the property saves the value entered in the control.

My interpretation of a bound box was if there was code behind the form
telling the checkbox what to do, it was bound.
The other thought was that a bound box was where you had a chosen field
under the properties > value tab, it was bound.
Which one is correct??
Corey



Sue Mosher [MVP-Outlook] wrote:
CheckBox1 etc. sounds like a control name, not an Outlook custom property name. UserProperties is an Outlook object model collection. THerefore, it takes as its argument the name of a custom Outlook property, specifically the property bound to that check box. If you are not using bound controls, then see http://www.outlookcode.com/d/propsyntax.htm#unbound for the syntax to get a property value from a control.

Sue~
Once I put in the strBody entries, none of the checkboxes are
transferring now.

Receiving a VB Run Time Error : Object variable not set. (Starting at
Line 3)
I inserted 2 note fields to explain my setup for you.
Can't continue further on.
______________________________________________________________________________________________________
Here's my code.
1 Sub Item_Send()
2 strBody = Item.Body
' NOTE: CheckBox1 is the actual name in the properties
3 If Item.UserProperties ("CheckBox1") = True Then
4 strBody = strBody & vbCrLf & "Please Call"
' NOTE: Please call is in the Caption Field
5 End If
6 If Item.UserProperties ("CheckBox2") = True Then
7 strBody = strBody & vbCrLf & "Returned Your Call"
8 End If
9 If Item.UserProperties ("CheckBox3") = True Then
10 strBody = strBody & vbCrLf & "Special Attention"
11 End If
12 If Item.UserProperties ("CheckBox4") = True Then
13 strBody = strBody & vbCrLf & "Confidential"
14 End If
15 If Item.UserProperties ("CheckBox5") = True Then
16 strBody = strBody & vbCrLf & "Rush"
17 End If
18 If Item.UserProperties ("CheckBox6") = True Then
19 strBody = strBody & vbCrLf & "Telephoned"
20 End If
21 If Item.UserProperties ("CheckBox7") = True Then
22 strBody = strBody & vbCrLf & "Wants to See You"
23 End If
24 If Item.UserProperties ("CheckBox8") = True Then
25 strBody = strBody & vbCrLf & "Will Call Again"
26 End If
27 If Item.UserProperties ("CheckBox9") = True Then
28 strBody = strBody & vbCrLf & "Came to See You"
29 End If
30 Item.Body = strBody
31 End Sub

Here are the PROPERTIES of the checkbox:
Display Tab (Tab 1)
NAME: CheckBox1
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab (Tab 2)
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value
(Tab 3)
Nothing is set.
_____________________________________________________________________________________________________
Sue Mosher [MVP-Outlook] wrote:
What is the code on line 5? The script needs to use the *exact* name of the field. If you have need to build up the body with multiple items, it may be better to build one string, then set the Body property:

Sub Item_Send()
strBody = Item.Body
If Item.UserProperties("property for checkbox1") = True Then
strBody = strBody & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
strBody = strBody & vbCrLf & "please call soon"
End If
'etc
Item.Body = strBody
End Sub

That would also make it easy to throw in a few MsgBox statements to help you troubleshoot how strBody looks after each addition.

Thank you for that.
I followed your script, but only 1 checkbox carried over to the message
field.
I was getting a script debugging screen starting at line 5. I made
sure everything matched the settings on the first checkbox and they do.
Not sure why it would be skipping the remaining 8.

Here are the properties of the good checkbox:
Display Tab
NAME: CametoSeeYou
Caption: Came to See You
Settings: Visible, Enabled, Sunken
Value Tab
Choose Field: CametoSeeYou
Type: Yes/No
Format: Icon
Property to Use: Value

This is the one that transfers over. I used the same settings on the
remainder, but they don't transfer.

Corey



Sue Mosher [MVP-Outlook] wrote:
The page I suggested has all the building blocks you need, but it's not the PropertyChange/CustomPropertyChange event. What you need from that page is the syntax for standard and custom properties -- Item.propertyname and Item.UserProperties("propertname") -- respectively and the syntax for handling unbound controls.

You have to fill in the details, because we can't read your mind or see your form. It sounds like you've identified that your checkbox is bound to an Outlook property, right? Only you know what property that might be. We also don't know what you mean by "the name of the checkbox" -- whether that's supposed to be the name of the bound property or the checkbox caption or the name of the checkbox control.

As for the message body, if you looked in the object browser (F2) in VBA, you'd see there are two properties related to the message body -- Body and HTMLBody. We don't know which one you want to use.

If you prefer If ... End If blocks to Select Case blocks, that's fine. I personally think they're unwieldy if you have a lot of properties whose changes you want to handle.

So, if we make a lot of assumptions about your form that we have no reason to be able to make, a barebones Item_Send procedure to put information related to two bound checkboxes into the body of a message, without caring about its formatting might be:

Sub Item_Send()
If Item.UserProperties("property for checkbox1") = True Then
Item.Body = Item.Body & vbCrLf & "wants to see you"
End If
If Item.UserProperties("property for checkbox2") = True Then
Item.Body = Item.Body & vbCrLf & "please call soon"
End If
End Sub

Of course, if these are unbound checkboxes, then you need to use the other syntax described on that page to get the value from the control.

Sue,
I've read the information you requested. However, in the area of your
Outlook script below there's no code to drop into the following area:

' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor

Now, in Excel, (which this is not obviously) you would use an if/then
function. If this cell equals Yes, then give it a number and add it to
something. Then I'd hook it up to a macro. Etc. Etc.

No offense, but in asking again for a straight out code solution
wrather than a "refer to my book" answer, what is the code to make this
following statement happen. "If the check box is marked in an Outlook
form, paste "the name" of the checkbox to the message body text?"

Sue Mosher [MVP-Outlook] wrote:
I'd suggest, then, that you do one of the walkthroughs listed at http://www.outlookcode.com/d/forms.htm that introduce you to the idea of programming VBScript code for Outlook forms.

Sue,
I'm new to this programming side of Outlook. I went into the Script
editor and was able to pull down the Item Send start and end prompt.
However, from there I'm lost.
Any assistance would be appreciated.
Corey

Sue Mosher [MVP-Outlook] wrote:
You'd need to write code behind the form, probably in the Item_Send event handler to build the Body or HTMLBody property from the fields you're interested in. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax.

I have a Custom Phone Message form with check boxes.
What I'm trying to do is, upon selection of the text box, to have the
value be pasted into the message body.
Is there a way to do this?
For instance, you check "wants to see you", it'll then paste "wants to
see you" in the message body.
Same for the remaining check boxes.
 
That's great that you've done all that. Where did you publish the form?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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

Back
Top