We can use WdFieldType Enum to find Citation.
I did not use VSTO but used a console app to write a piece of code, but you should be able to easily modify it to what you need.
Application application = null;
Document document = null;
try
{
application = new Application();
document = application.Documents.Open(@"C:\...\1.docx");
string str = "test";
foreach (Field field in document.Fields)
{
if (field.Type == WdFieldType.wdFieldCitation)
{
Range range = field.Result;
if (range.Text == str)
{
range.Underline = WdUnderline.wdUnderlineSingle;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
document.Save();
document.Close();
application.Quit();
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.