A
agraashish
Hi All,
I am trying to automatically update several word documents(using VS2008 and
C#) which are in 20003/2007 format.I want to update some specific fields of
the HEADERS and FOOTERS.I tried the following code but after the Header is
updated its settings change,so is there a way using which I can update the
documents keeping the same settings of Header?
Code Sample:
foreach (Microsoft.Office.Interop.Word.Section section in doc.Sections)
{
section.Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text =
section.Headers
[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.Replace("some value
read from header", "new value of field");
}
I am trying to automatically update several word documents(using VS2008 and
C#) which are in 20003/2007 format.I want to update some specific fields of
the HEADERS and FOOTERS.I tried the following code but after the Header is
updated its settings change,so is there a way using which I can update the
documents keeping the same settings of Header?
Code Sample:
foreach (Microsoft.Office.Interop.Word.Section section in doc.Sections)
{
section.Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text =
section.Headers
[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text.Replace("some value
read from header", "new value of field");
}