![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I am creating a custom OL2007 task form with coding in Outlook. I saw the
outlookcode.com page "Syntax for outlook property and form control values and events" and got the PropertyChange fucntion to work with a case statement (see first two lines of case statement). But when I want to change the value of the field that I want to it doesn't work. A little background, I have a text box named txtTestBox bound to a user-defined field "TestBox". I know my function and case statement works, but how do I grab my user-defined field to manipulate it like I could the message box and the task.subject? I tried SEVERAL different syntaxes, as you can see below, but I think it's obvious I'm clueless. (Note-- I thought I would use the PropertyChange function rather than the CustomPropertyChange because I did not create a custom property... I created a custom field but not a custom property... but it will only work with CustomPropertyChange??) (And yes, I only try the lines in the case statements one at a time.) Any input?? Sub Item_CustomPropertyChange(ByVal Name) on error resume next Select Case Name Case "Field1" 'MsgBox "You changed Field1" 'works 'Item.subject = "Works!" 'works 'Item.TestBox.text = "works!" 'doesn't work?? 'Item.TestBox.value= "works!" 'doesn't work?? 'TestBox.text = "works!" 'doesn't work?? 'TestBox.value = "works!" 'doesn't work?? 'Item.TestBox = "works!" 'doesn't work?? 'TestBox = "works!" 'doesn't work?? End Select End Sub -- Message posted via http://www.officekb.com |
#2
|
|||
|
|||
![]()
A custom field and a custom property are the same thing. "Field" is a
synonym for "property" in the Outlook code context. If you go back to the page you cited, at http://www.outlookcode.com/article.aspx?ID=38, the section on custom properties shows how to access custom field/property values. It also shows how to work with unbound controls, in case you have some of those, too. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "cmonroe21 via OfficeKB.com" u48566@uwe wrote in message news:9710fdc23ba0d@uwe... I am creating a custom OL2007 task form with coding in Outlook. I saw the outlookcode.com page "Syntax for outlook property and form control values and events" and got the PropertyChange fucntion to work with a case statement (see first two lines of case statement). But when I want to change the value of the field that I want to it doesn't work. A little background, I have a text box named txtTestBox bound to a user-defined field "TestBox". I know my function and case statement works, but how do I grab my user-defined field to manipulate it like I could the message box and the task.subject? I tried SEVERAL different syntaxes, as you can see below, but I think it's obvious I'm clueless. (Note-- I thought I would use the PropertyChange function rather than the CustomPropertyChange because I did not create a custom property... I created a custom field but not a custom property... but it will only work with CustomPropertyChange??) (And yes, I only try the lines in the case statements one at a time.) Any input?? Sub Item_CustomPropertyChange(ByVal Name) on error resume next Select Case Name Case "Field1" 'MsgBox "You changed Field1" 'works 'Item.subject = "Works!" 'works 'Item.TestBox.text = "works!" 'doesn't work?? 'Item.TestBox.value= "works!" 'doesn't work?? 'TestBox.text = "works!" 'doesn't work?? 'TestBox.value = "works!" 'doesn't work?? 'Item.TestBox = "works!" 'doesn't work?? 'TestBox = "works!" 'doesn't work?? End Select End Sub -- Message posted via http://www.officekb.com |
#3
|
|||
|
|||
![]()
Thank you! Item.UserProperties("TestBox").Value = "works!" worked!!
I thought that TestBox was a field that had properties, but was not a property itself... obviously my train of thought was not correct! Got my head wires crossed! Thank you for your help! Sue Mosher [MVP] wrote: A custom field and a custom property are the same thing. "Field" is a synonym for "property" in the Outlook code context. If you go back to the page you cited, at http://www.outlookcode.com/article.aspx?ID=38, the section on custom properties shows how to access custom field/property values. It also shows how to work with unbound controls, in case you have some of those, too. I am creating a custom OL2007 task form with coding in Outlook. I saw the outlookcode.com page "Syntax for outlook property and form control values [quoted text clipped - 33 lines] End Select End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...forms/200906/1 |
#4
|
|||
|
|||
![]()
No, your first instinct was correct. A look at the object browser (F2 in
VBA) would show you that the UserProperty object itself has properties, such as the Value property in your code snippet. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "cmonroe21 via OfficeKB.com" u48566@uwe wrote in message news:971188b125ec1@uwe... Thank you! Item.UserProperties("TestBox").Value = "works!" worked!! I thought that TestBox was a field that had properties, but was not a property itself... obviously my train of thought was not correct! Got my head wires crossed! Thank you for your help! Sue Mosher [MVP] wrote: A custom field and a custom property are the same thing. "Field" is a synonym for "property" in the Outlook code context. If you go back to the page you cited, at http://www.outlookcode.com/article.aspx?ID=38, the section on custom properties shows how to access custom field/property values. It also shows how to work with unbound controls, in case you have some of those, too. I am creating a custom OL2007 task form with coding in Outlook. I saw the outlookcode.com page "Syntax for outlook property and form control values [quoted text clipped - 33 lines] End Select End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...forms/200906/1 |
#5
|
|||
|
|||
![]()
Thank you Sue. I think you are my new hero
![]() Sue Mosher [MVP] wrote: No, your first instinct was correct. A look at the object browser (F2 in VBA) would show you that the UserProperty object itself has properties, such as the Value property in your code snippet. Thank you! Item.UserProperties("TestBox").Value = "works!" worked!! [quoted text clipped - 16 lines] End Select End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...forms/200906/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help to modify the code | Boss | Outlook and VBA | 4 | December 20th 07 01:19 PM |
Migration from CDO 1.2 to OOM2007: field/property handling??? | Benedikt | Outlook and VBA | 1 | December 11th 07 02:22 PM |
Modify Code Using Outlook Redemption to bypass security prompts | mhgreene | Outlook and VBA | 5 | October 3rd 07 10:50 PM |
how do I modify the message field in an outlook form ? | jackie | Outlook - Using Forms | 1 | August 17th 06 11:07 PM |
Modify CC Field | Kamek | Outlook and VBA | 3 | July 6th 06 10:00 PM |