M
Maurice
Hi,
I developed a Word Addin which applies some custom setting to the properties
of a set of Word document templates. I am currently encountering the
following issue.
After reading the custom properties I apply them to the document (generated
form the template) with the follwing code:
-------------------
foreach (Microsoft.Office.Interop.Word.Section documentSection in
doc.Sections)
{
documentSection .Range.Fields.Update()
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields.Update();
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.Fields.Update();
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Range.Fields.Update();
}
------------------
This works fine for templates WITH a visible header.
But if the template has NO header enabled (per default this is within the
doc but not visible), it is VISIBLE after the update of the headers part.....
Any ideas on how to prevent this unwanted behavior??
Regards
Maurice
I developed a Word Addin which applies some custom setting to the properties
of a set of Word document templates. I am currently encountering the
following issue.
After reading the custom properties I apply them to the document (generated
form the template) with the follwing code:
-------------------
foreach (Microsoft.Office.Interop.Word.Section documentSection in
doc.Sections)
{
documentSection .Range.Fields.Update()
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields.Update();
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.Fields.Update();
documentSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Range.Fields.Update();
}
------------------
This works fine for templates WITH a visible header.
But if the template has NO header enabled (per default this is within the
doc but not visible), it is VISIBLE after the update of the headers part.....
Any ideas on how to prevent this unwanted behavior??
Regards
Maurice