Link to home
Start Free TrialLog in
Avatar of JazC
JazCFlag for New Zealand

asked on

Using a TEditMask

I want to have a field in outlook that is in the format

{1234567890123456789012345678901234567890};Joe Smith;

The first part is an entryid of a contact item in outlook, which is always a set length, the second part is the contacts name.

I would like to have field control that only displays the name data and not the entryid data.

The question is can I do this with a mask, and if so, what would the syntax look like for the mask. I also don't want the entryid text to appear if the insertion point is entered into the field. In fact the contact name and entryid data cannot be entered manually, rather it will be filled from another form.

Is this possible with a mask, or do i need something a little different?

Jay
Avatar of ginsonic
ginsonic
Flag of Romania image

Maybe use POS function to find ; simbol and then use Copy function to copy from ; to end .
ASKER CERTIFIED SOLUTION
Avatar of ginsonic
ginsonic
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To get the first part of the string :

Edit2.Text:=Copy(s,1,x-1);
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Look similar with my idea . Don't think ?
Avatar of geobul
geobul

My idea is to use OnChange event of a regular TEdit component do do the desired task. The code implementation is actually the same, of course.

Regards, Geo
(... do do ...) should be (... to do ...)
I think so
Some body with a new face :) Just a joke .

I belive that JazC don't wish to type alike strings .
He want ( I think ) to read from a list a specified alike string and to display just the name part ( to display or modify the contact name ? )

So in my opinion your solution isn't desired one ( maybe I'm wrong and he really want to type alike strings ).

Anyway hope to solve JazC's problem .

Nick
If I have this problem, I will use a string array to do this job . Store ID and names . When choice a name (ID) get the correspondent ID (name).
Can modify what I need and when need to use just glue the ID+';'+name.

Sorry for my bad english .
OnChange event is fired when the Text property is changed. It doesn't matter if it has been changed manually (using keyboard) or via code (assignment) as it's in my example above.

Using OnChange you don't need to call any special convertion function explicitly every time when you are assigning a new value to the Text property. Just like an output mask would do. And that's our goal I think.

Regards, Geo
I know that . And this is the similarity .
You convert when receive the text (inside OnChange) and I send already converted text.

Bouth codes do same work but at different moments.

But let's stop this topic. We can talk for a long time about ... :) Let's help people .
Avatar of JazC

ASKER

The big thing is, this will be in an ActiveX control, the ActiveX control will reside in a Outlook econtact Form. The control can be bound by one piece of Data.

After saying that i thinkk I have answered my own question, just store the real value in a property that is bound, but only display the text name of the contact in a text box

Maybe I should have just slept on the idea for a night, I only came up with the idea yesterday.

Anyway, I will try it and see if I get a desired result.

Will get back to you people by the end of today.

Jay
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between geobul and ginsonic

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
Avatar of JazC

ASKER

Split between geobul and ginsonic
JazC:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.