All,
I am using OpenXML to automatically insert text into bookmarks. The following is working phenomenally:
Body body = mainPart.Document.GetFirstChild<Body>();
var bookMarkStarts = body.Descendants<BookmarkStart>();
var bookMarkEnds = body.Descendants<BookmarkEnd>();
foreach (BookmarkStart bookMarkStart in bookMarkStarts)
{
if (bookMarkStart.Name == bookmarkName)
{
//Get the id of the bookmark start to find the bookmark end
var id = bookMarkStart.Id.Value;
var bookmarkEnd = bookMarkEnds.Where(i => i.Id.Value == id).First();
var runElement = new Run(new Text("Hello World!!!"));
bookmarkEnd.Parent.InsertAfter(runElement, bookmarkEnd);
}
}
I was wondering if someone could help me change the styling of the text within the bookmarks. Right now they are all bolded and I would prefer if they were not. I would possibly like to change the color of the text as well.
I thank you