I have some code to find and replace fields in a word document with values from a dataset.
Word.Document oWordDoc = new Word.Document();
foreach (Word.Field mergeField in oWordDoc.Fields)
{
mergeField.Select();
oWord.Selection.TypeText( stringValueFromDataSet );
}
In some cases stringValueFromDataSet
is empty, and in addition to inserting nothing, I want to actually delete the current line.
Any idea how I can do this?