User defined fields

Status
Not open for further replies.
M

Mr. GetRight

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,
 
S

Sue Mosher [MVP]

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

You also might want to read the background information here:

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

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

Sue Mosher

"Mr. GetRight" <MrGetRight> wrote in message

news:69D1E389-81D5-459B-B519-ABF2FF3EE214@microsoft.com...
> 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,
 
M

Mr. GetRight

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,
 
S

Sue Mosher [MVP]

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

"Mr. GetRight" <MrGetRight> wrote in message

news:E20C38BD-815D-4BB2-8632-5DEA6FC30133@microsoft.com...
> 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,
 
M

Mr. GetRight

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

However, nothing happens. What am i doing wrong?

sub CommandButton1_Click()

Set ListBox1V =

Item.GetInspector.ModifiedFormPages("Message").Controls("ListBox1")

Set TextBoxV =

Item.GetInspector.ModifiedFormPages("Message").Controls("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:

"Sue Mosher [MVP]" wrote:


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

> "Mr. GetRight" <MrGetRight> wrote in message
> news:E20C38BD-815D-4BB2-8632-5DEA6FC30133@microsoft.com...
> > 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,


> .
>
 
M

Mr. GetRight

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").Controls("ListBox1")

Set TextBoxV =

Item.GetInspector.ModifiedFormPages("Message").Controls("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

> However, nothing happens. What am i doing wrong?
> sub CommandButton1_Click()

> Set ListBox1V =
> Item.GetInspector.ModifiedFormPages("Message").Controls("ListBox1")
> Set TextBoxV =
> Item.GetInspector.ModifiedFormPages("Message").Controls("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:

> "Sue Mosher [MVP]" wrote:
>
> > 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
> > > > > > > > "Mr. GetRight" <MrGetRight> wrote in message
> > news:E20C38BD-815D-4BB2-8632-5DEA6FC30133@microsoft.com...
> > > 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,

> > .
> >
 
S

Sue Mosher [MVP]

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

"Mr. GetRight" <MrGetRight> wrote in message

news:183310FF-2005-49AD-927F-5AF6CFB53612@microsoft.com...
> 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").Controls("ListBox1")
> Set TextBoxV =
> Item.GetInspector.ModifiedFormPages("Message").Controls("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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S User Defined Fields adding new value (2) Using Outlook 0
M vCard does not have user-defined fields from my custom contact form (365) Using Outlook 1
F MAPI, User Defined Fields and perspective after 20 years Outlook VBA and Custom Forms 0
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
M Multiple User Defined Fields that can be added, changed, updated using VBA and user form Outlook VBA and Custom Forms 0
R User Defined Fields adding new value Using Outlook 3
S VBA with User Defined fields Outlook VBA and Custom Forms 9
M Map Outlook user defined fields onto a Sharepoint list ??? Outlook VBA and Custom Forms 1
N How to retrieve user defined fields values to bcm form. Using Outlook 2
N How to disable user defined fields in BCM forms Using Outlook 2
K User Defined Fields in Outlook 2010 Using Outlook 2
P User-Defined Relationship Fields: Invisible? BCM (Business Contact Manager) 0
W Template to produce calendars with wrapped text & user-defined fields? Using Outlook 1
R writing "Instant Search" queries to find User-Defined fields Using Outlook 0
P Joining the User Defined Fields to their User Field&lt;n&gt; counterpart BCM (Business Contact Manager) 0
E Accessing User Defined Fields in BCM Database part 2 BCM (Business Contact Manager) 0
E [SOLVED] Accessing User Defined Fields in BCM Database part 1 BCM (Business Contact Manager) 9
J User Defined Fields Outlook VBA and Custom Forms 6
J user defined fields Outlook VBA and Custom Forms 2
P Where are User-defined fields stored in BCM 2010 database? BCM (Business Contact Manager) 2
J User defined fields with pre-defined values Outlook VBA and Custom Forms 3
J Where does BCM store User-Defined fields in the database? BCM (Business Contact Manager) 3
D User-defined fields and multiple forms BCM (Business Contact Manager) 1
T User Defined Fields vs. Area of Interest BCM (Business Contact Manager) 1
C User Defined Fields BCM (Business Contact Manager) 3
H Information from user defined field into Excel Outlook VBA and Custom Forms 7
B User defined field for messages with 'me' in the [To], [Cc] line Using Outlook 0
R Creating a user defined function Outlook VBA and Custom Forms 3
M Compile error: User-defined type not defined Outlook VBA and Custom Forms 0
C Outlook 2016 Conditional Format for User Defined Field Using Outlook 1
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
J Assess content of User Defined Field in Rule Using Outlook 3
S Outlook User defined date field (UDF) not syncing Using Outlook 2
G how can Apply User-defined Field to all Sub Folder and Other Using Outlook 14
F Adding User Defined Field to another form Using Outlook 0
G How to let data in an account user defined field appear in the same field all related opportunities BCM (Business Contact Manager) 1
V Extracting user-defined details from a public folder Outlook VBA and Custom Forms 2
J How to show the "value" of a user-defined Account field in a Contact Record BCM (Business Contact Manager) 2
witzker Outlook bug when creating a user defined contact form? Using Outlook 1
Wotme Syntax for user defined field in VBA Using Outlook 1
J How to create a user defined dropdown list field for a custom contact form Using Outlook 3
S User defined field not showing in Custom view Exchange Server Administration 0
T issue/ base and user defined contact types BCM (Business Contact Manager) 2
D User Defined Info Gone Using Outlook 1
S [SOLVED] Search by User-Defined Relationship Field BCM (Business Contact Manager) 2
C User defined field not found in any views prints. Cannot locate to delete. Using Outlook 2
M user-defined properties in printed emails? Outlook VBA and Custom Forms 8
M What is the recommendet way to read/write a user defined Field (Named Property) in the MailItem Obje Outlook VBA and Custom Forms 1
M What is the recommendet way to read/write a user defined Field (Named Property) in the MailItem Obje Outlook VBA and Custom Forms 5

Similar threads

Top