none
HitHighlight method returns "False" (sporadicly, rare case) though the term is available in Outlook mail RRS feed

  • Question

  • Hi,

    I have used the HitHighlight method to do the highlighting in outlook mail after a search term has been passed by user to the method. It is working fine but very rarely observed that, it is returning False though the term is available in the mail and thus the terms are not being highlighted in that case.

    This issue is sporadic and rarely happens. When I switch to a different mail and come back again, it works.

    Could anyone please let me know, what could be the issue and how to fix the problem? There are no exceptions from the API.

    Thursday, October 15, 2015 10:09 AM

Answers

  • Hi Kunal,

    I am trying to reproduce this issue however failed. Please ensure that there is also no exception before the code HitHighlight so that this method was executed.

    Also if this issue occurred, can you using HitHighlight feature manually successfully? Here is an deme for the testing to highlight the 'h' in the message in active inspector:

    Sub Find()
    With Application.ActiveInspector.WordEditor.Application.Selection.Find
        .ClearFormatting
        .ClearHitHighlight
    Debug.Print .HitHighlight("h")
    End With
    End Sub

    If you still have the issue, would you mind sharing the code with us?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 16, 2015 2:29 AM
    Moderator

All replies

  • Hello Kunal,

    VSTO doesn't provide any HitHighlight methods. Do you develop a VSTO based add-in?

    Thursday, October 15, 2015 10:17 AM
  • Hi Kunal,

    I am trying to reproduce this issue however failed. Please ensure that there is also no exception before the code HitHighlight so that this method was executed.

    Also if this issue occurred, can you using HitHighlight feature manually successfully? Here is an deme for the testing to highlight the 'h' in the message in active inspector:

    Sub Find()
    With Application.ActiveInspector.WordEditor.Application.Selection.Find
        .ClearFormatting
        .ClearHitHighlight
    Debug.Print .HitHighlight("h")
    End With
    End Sub

    If you still have the issue, would you mind sharing the code with us?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 16, 2015 2:29 AM
    Moderator