String containing '@' with wildcard

2

I wanted to find something with the function range.Find.Execute() , since I need to find all the words that start with an at @ and the wildcards that probe were:

(@)*
(^064)*

But none of them helped me. With which one can I find this kind of chains?

Update:

private void Findvar(Word.Range Range, object findText){
    var rng = Range;    
    rng.Collapse();
    object saveas = true;
    object missing = System.Reflection.Missing.Value;

    while (rng.Find.Execute(findText, ref missing, ref missing, ref saveas, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing))
    {
        //rng.Font.Bold = 1;
        rng.Text = " "+rng.Text.Substring(3);
        Findvar(rng, findText);
    }
}

This is my function, it receives a string and a range and does something, in this case it inserts the same text found but cut.

    
asked by Ernesto Chacón Pintor 10.08.2017 в 21:07
source

1 answer

2

You have to look for \@ but you can not put it directly because it marks error of

  

Unrecognized escape sequence

So a quick fix was this:

string a = "(\@)*";
Findvar(Globals.ThisAddIn.Application.Selection.Range, a);

So I can find any string that starts with @

    
answered by 11.08.2017 / 17:58
source