none
Outlook 2010: Unnable to search numbers in the custom field. RRS feed

  • Question

  • Hi all,

    I've added a new table view to a folder with several custom columns. One of the columns is a "string" type column but only store numbers (the number is a string when assign value to the column field).

    However, I'm not able to search values in the custom column. Is there any limitation when searching text in the custom view fields? Thanks

    Friday, April 6, 2012 7:34 AM

All replies

  • usually if you want to search by user properties, you have to make sure they are added on folder level also, either by passing true flag when adding UserProperties.Add or by explicitly setting in on Folder object in UserDefinedProperties
    Friday, April 6, 2012 8:28 AM
  • What exactly do you mean by "not able to search"? Do you get an error?

    What is your code that sets up the search filter?

    
    
    
    
    
    
    

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Friday, April 6, 2012 2:17 PM
  •                


    The code is like:

    var newUserProperty = newMailItem.UserProperties.Add("CaseNoProperty", Outlook.OlUserPropertyType.olText, true);
    newUserProperty.Value = "010094";

    And I have create a folder view for the folder, it has an xml node:

    <column>
        <heading>Case Number</heading>
        <prop>CaseNoProperty</prop>
        <type>string</type>
        <width>25</width>
        <sortable>0</sortable>
        <style>
            padding-left:3px;;text-align:left</style>
        <editable>1</editable>
    </column>

    When I type "010094" in the search bar on the right top of folder view, it gives me "no result". But I can see "010094" is actually displayed in the "Case Number" column.


    • Edited by Malone Ma Sunday, April 8, 2012 12:40 PM
    Sunday, April 8, 2012 12:39 PM
  • Yes, I passed "true" to the third arguments of UserProperties.Add method. I also tried to add a udf in the folder level still no luck.

    var newUserProperty = newMailItem.UserProperties.Add("CaseNoProperty", Outlook.OlUserPropertyType.olText, true);
    newUserProperty.Value = "010094";

    Sunday, April 8, 2012 12:41 PM
  • The search invoked through the UI searches through a predefined set of fields, I don't think it will search on custom properties.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Sunday, April 8, 2012 3:23 PM
  • Any workaround? Even if I stored the custom field values in body, to or subject field, the search still cannot find them sometime. Especially when I search part of the text, it always gives me none.
    Wednesday, April 11, 2012 11:16 AM
  • how do you search part of the text? (i assume by text you mean body of item)
    Wednesday, April 11, 2012 11:22 AM
  • Let's say I have a mail item, its subject is "subjectTest". It has a custom field -> field1, its value is 009007. I appended "009007" to the subject. Now the mail item has subject "subjectTest009007" and field1 "009007".

    I start search "007". And the results is none. I then modify the search cretieria to "009007". This time it gives me a result. Note I've enabled "Instance Search". If I disable the "Instance Search", I'm able to get result by search "007".

    Wednesday, April 11, 2012 1:13 PM
  • Have you tried to make sure there is a space between the old subject and the custom value "subjectTest 009007"?

    

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, April 11, 2012 2:49 PM
  • check this link this may help you out


    http://www.pcreview.co.uk/forums/search-custom-fields-t2452986.html

    Saturday, April 21, 2012 12:49 PM