elem
is obtained by searching various document parts, both MainDocumentPart.Document and HeaderParts:
Text text =开发者_开发技巧 elem.GetFirstChild<Text>();
System.Console.Write("Updating content from '{0}'", text.Text);
text.Text = "blah";
System.Console.WriteLine(" to '{0}'", text.Text);
In all cases the output is exactly as expected to stdout, it looks to work perfectly. But when the file is saved, only changes to the main body text are seen... the header remains unchanged. Do I have to unlock the header or something?
Call HeaderPart.Header.Save()
on the Header that contains elem
.
精彩评论