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.