protected override void ReplaceFontElementNames(string strFontNameOld, string strFontNameNew) { // Update, for the D:\temp\BWDC\Dennis\Steve Parker\Steve P Working\Steve P Legacy files, // I think we don't want to just change the name, but get rid of the element altogether... // (or it could display improperly if the original was a symbol font) // So now, just delete it... Word should be able to recreate it if it's actually needed // <w:font w:name="Mangal"> foreach (var fontElement in FontsListRoot.Elements(w + "font").Where(e => GetAttributeValue(e, w + "name") == strFontNameOld)) { fontElement.Remove(); } // <w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman" /> // and if that font is used as one of the ranges of the 'defaultFonts' element, then change that too UpdateAllChildElementAttributesValue(FontsListRoot, w + "defaultFonts", strFontNameOld, strFontNameNew); }
public override bool HasFonts(List <string> astrFontsToSearchFor) { return(FontsListRoot.Elements(w + "font") .Any(e => astrFontsToSearchFor.Contains(GetAttributeValue(e, w + "name")))); }