A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do I grab a field property (like .value) so I can modify it via OL code?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 3rd 09, 10:52 PM posted to microsoft.public.outlook.program_forms
cmonroe21 via OfficeKB.com
external usenet poster
 
Posts: 53
Default How do I grab a field property (like .value) so I can modify it via OL code?

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  
Old June 3rd 09, 11:33 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default How do I grab a field property (like .value) so I can modify it via OL code?

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  
Old June 3rd 09, 11:55 PM posted to microsoft.public.outlook.program_forms
cmonroe21 via OfficeKB.com
external usenet poster
 
Posts: 53
Default How do I grab a field property (like .value) so I can modify it via OL code?

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  
Old June 4th 09, 12:03 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default How do I grab a field property (like .value) so I can modify it via OL code?

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  
Old June 4th 09, 09:53 PM posted to microsoft.public.outlook.program_forms
cmonroe21 via OfficeKB.com
external usenet poster
 
Posts: 53
Default How do I grab a field property (like .value) so I can modify it via OL code?

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
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.