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

User defined fields



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 14th 09, 01:21 PM posted to microsoft.public.outlook.program_forms
Mr. GetRight
external usenet poster
 
Posts: 4
Default User defined fields

Hey, need help understanding how to do user defined fields.
I have created a from, and wrote the code, it workes just like i wanted it
with one expection. When you send the form it doesn't keep the data in the
fields. I found out that i have to make user defined fields.
However when i made the fields i am having trouble accessing the fields with
my code now. I have read diff sites and microsoft and they say i should be
ref to fields as:
Item.UserProperties.Find("TextBox1")
Can someone show me now to access userdifined fields using just a command
box and text box? Also, anywhere i can go to read more about it.
Thanks,
Ads
  #2  
Old December 14th 09, 02:06 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default User defined fields

TextBox1 sounds like the name of a control on the form, not a custom field.

You also might want to read the background information he

http://www.outlookcode.com/article.aspx?id=29
http://www.outlookcode.com/article.aspx?id=32

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


"Mr. GetRight" wrote in message
...
Hey, need help understanding how to do user defined fields.
I have created a from, and wrote the code, it workes just like i wanted it
with one expection. When you send the form it doesn't keep the data in the
fields. I found out that i have to make user defined fields.
However when i made the fields i am having trouble accessing the fields
with
my code now. I have read diff sites and microsoft and they say i should be
ref to fields as:
Item.UserProperties.Find("TextBox1")
Can someone show me now to access userdifined fields using just a command
box and text box? Also, anywhere i can go to read more about it.
Thanks,



  #3  
Old December 14th 09, 02:15 PM posted to microsoft.public.outlook.program_forms
Mr. GetRight
external usenet poster
 
Posts: 4
Default User defined fields

Ok, I figured out how to access the text box. NOW, I need to know how to
create user defined list box. My form has 4 list box that the user will be
adding data through and when they email it i want those fields to remain on
the form, but as it is right now, i dont seem to know how to make listbox
only text...

sub CommandButton1_Click()
Item.UserProperties("TextBox1") = "It Works"
End Sub

"Mr. GetRight" wrote:

Hey, need help understanding how to do user defined fields.
I have created a from, and wrote the code, it workes just like i wanted it
with one expection. When you send the form it doesn't keep the data in the
fields. I found out that i have to make user defined fields.
However when i made the fields i am having trouble accessing the fields with
my code now. I have read diff sites and microsoft and they say i should be
ref to fields as:
Item.UserProperties.Find("TextBox1")
Can someone show me now to access userdifined fields using just a command
box and text box? Also, anywhere i can go to read more about it.
Thanks,

  #4  
Old December 14th 09, 02:36 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default User defined fields

What do you mean by "adding data through" the list box and "make listbox
only text"?

Before you go too far down this road, you might want to make sure you can
meet the prerequisites for custom message forms:
http://www.outlookcode.com/article.aspx?id=61
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Mr. GetRight" wrote in message
...
Ok, I figured out how to access the text box. NOW, I need to know how to
create user defined list box. My form has 4 list box that the user will be
adding data through and when they email it i want those fields to remain
on
the form, but as it is right now, i dont seem to know how to make listbox
only text...

sub CommandButton1_Click()
Item.UserProperties("TextBox1") = "It Works"
End Sub

"Mr. GetRight" wrote:

Hey, need help understanding how to do user defined fields.
I have created a from, and wrote the code, it workes just like i wanted
it
with one expection. When you send the form it doesn't keep the data in
the
fields. I found out that i have to make user defined fields.
However when i made the fields i am having trouble accessing the fields
with
my code now. I have read diff sites and microsoft and they say i should
be
ref to fields as:
Item.UserProperties.Find("TextBox1")
Can someone show me now to access userdifined fields using just a command
box and text box? Also, anywhere i can go to read more about it.
Thanks,



  #5  
Old December 14th 09, 10:16 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default User defined fields

As you've read, changes to controls' UI, including setting rows in list
boxes, are not persisted when items are saved or sent. For another user to
see the same rows when opening the item, you would need to put code in the
Item_Open event handler to perform the same operation, e.g. AddItem. Think
this through:

How would the form know what data to put in the rows? There's only one
possible answer: The data must be stored in the item.

How can an item store extra data data? Again, the answer should be obvioius:
In a custom field.

How does the data get into the custom field? Either the user enters it
manually or code behind the form puts it there.

Given what little I know about your scenario, I'd use code in the Item_Send
event handler to get the rows from the list box and store them in a custom
property as a comma-delimited list, which can then be read by the Item_Open
event handler.

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


"Mr. GetRight" wrote in message
...
I dont know why but my last post was not posted in correct order, pls read
this one instead
Sorry, for the confusion. This is an example of what i'm trying to do, if
you
can help me with this example then I can apply it to my project.
I have created a form with a ListBox1 a TextBox1 and a CommandButton1
My code for this was:
sub CommandButton1_Click()

Set ListBox1V =
Item.GetInspector.ModifiedFormPages("Message").Con trols("ListBox1")
Set TextBoxV =
Item.GetInspector.ModifiedFormPages("Message").Con trols("TextBox1")

ListBox1v.AddItem TextBoxV

End sub
----
Then when i sent the form, the reciption didn't see any of the info that
was
added to the ListBox1, I read a few site and they advised that controls
don't
keep the info when being sent. Instead, you must use "userdefined fields".
I then when to the properties of the objects on the form and under value,
added userdefined fields, and changed the coding to:

sub CommandButton1_Click()

Set ListBox1V = Item.UserProperties("ListBox1")
Set TextBoxV = Item.UserProperties("TextBox1")

ListBox1v.AddItem TextBoxV

End Sub

However, nothing happens. What am i doing wrong?

"Mr. GetRight" wrote:

Sorry, for the confusion. This is an example of what i'm trying to do, if
you
can help me with this example then I can apply it to my project.
I have created a form with a ListBox1 a TextBox1 and a CommandButton1
My code for this was:
sub CommandButton1_Click()

Set ListBox1V = Item.UserProperties("ListBox1")
Set TextBoxV = Item.UserProperties("TextBox1")

ListBox1v.AddItem TextBoxV


End Sub



 




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
User defined fields with pre-defined values John Bacon Outlook - Using Forms 3 September 24th 09 02:02 PM
How to move fields in custom form to "user-defined fields in folde austex Outlook - Using Contacts 0 January 9th 08 11:51 PM
How to design a custom form that use User defined fields defined on a particular folder (not the default inbox one) Lucas Campos[_2_] Outlook - Using Forms 5 August 17th 07 05:03 PM
How to retrieve User Defined fields defined in an Folder? Lucas Campos[_2_] Outlook - Using Forms 1 August 16th 07 09:32 PM
Outlook Contacts - Converting User-defined Item fields to Folder fields [email protected] Outlook - Using Contacts 1 September 29th 06 09:17 PM


All times are GMT +1. The time now is 07:07 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.