none
How to Create a Search functionality in Outlook Addin RRS feed

  • Question

  • I have created a windows form, having text box control,  and a tree view->it contains the list of all folders available under inbox.

    What i want is when i will type a text in text box the related folder under tree view should get selected.

    How could i do that?


    • Edited by NirajZ Thursday, October 11, 2012 6:49 AM
    • Moved by Mike Feng Friday, October 12, 2012 9:36 AM outlook (From:.NET Base Class Library)
    • Moved by Leo_GaoModerator Monday, October 15, 2012 2:23 AM (From:Outlook for Developers)
    Thursday, October 11, 2012 6:48 AM

Answers

  • I don't know what language you're using, but something like this in VB.NET: http://www.vbdotnetheaven.com/uploadfile/mahesh/auto-complete-textbox-in-vb-net/ would give you some ideas.
     
    For a textbox you can set autocomplete text and source to have the textbox automatically do type-ahead for you. What you'd need to do would be to have a list of all the folder nodes in your treeview, which should be easy for you, and then use the list as the source for the autocomplete list.
     
    There are lots of examples for something like this. I did a search using the term "vb.net textbox typeahead". For C# a similar search using "c# textbox typeahead" should return results for that language.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:a7c5d1a6-d317-4095-b2c4-c5260e05c699...
    i was thinking the same scenario, but as a new to development world i don't know how could i do that? Could you please redirect me to the proper code snippet

    Ken Slovak MVP - Outlook
    Friday, October 12, 2012 3:17 PM

All replies

  • I have created a windows form, having text box control,  and a tree view->it contains the list of all folders available under inbox.

    What i want is when i will type a text in text box the related folder under tree view should get selected.

    How could i do that?

    Thursday, October 11, 2012 6:51 AM
  • You would select the treeview node corresponding to the folder.
     
    Or are you asking how to implement a type-ahead functionality? For that you'd handle the TextChanged event for the textbox control and get the text in the control in the event handler. You could then compare that text to the folder names in the nodes, starting at either the root node or the previous starting point node. Then select the node where the text from the textbox control matches the start of the folder name.I'd use the StartsWith() function to do that.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:6ad602a9-295f-4035-bd69-4f5b6a7e172f...

    I have created a windows form, having text box control,  and a tree view->it contains the list of all folders available under inbox.

    What i want is when i will type a text in text box the related folder under tree view should get selected.

    How could i do that?


    Ken Slovak MVP - Outlook
    Thursday, October 11, 2012 2:12 PM
  • i was thinking the same scenario, but as a new to development world i don't know how could i do that? Could you please redirect me to the proper code snippet
    Friday, October 12, 2012 4:57 AM
  • Hi Nira,

    I have moved this thread to Outlook forum for better support.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 12, 2012 9:36 AM
  • I don't know what language you're using, but something like this in VB.NET: http://www.vbdotnetheaven.com/uploadfile/mahesh/auto-complete-textbox-in-vb-net/ would give you some ideas.
     
    For a textbox you can set autocomplete text and source to have the textbox automatically do type-ahead for you. What you'd need to do would be to have a list of all the folder nodes in your treeview, which should be easy for you, and then use the list as the source for the autocomplete list.
     
    There are lots of examples for something like this. I did a search using the term "vb.net textbox typeahead". For C# a similar search using "c# textbox typeahead" should return results for that language.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:a7c5d1a6-d317-4095-b2c4-c5260e05c699...
    i was thinking the same scenario, but as a new to development world i don't know how could i do that? Could you please redirect me to the proper code snippet

    Ken Slovak MVP - Outlook
    Friday, October 12, 2012 3:17 PM
  • See my answer in the VSTO forum you also posted in. Please only post in one forum so it will be easier to follow your questions and threads.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:b5bc88df-f9fa-402b-b0e4-5582a8cf8044...

    I have created a windows form, having text box control,  and a tree view->it contains the list of all folders available under inbox.

    What i want is when i will type a text in text box the related folder under tree view should get selected.

    How could i do that?



    Ken Slovak MVP - Outlook
    Friday, October 12, 2012 3:34 PM
  • Sorry for inconvenience, Some 1 moved my thread to this section, What can i do Sir?

    Saturday, October 13, 2012 3:51 AM