c# - Header document automatically added when search fields -


i have problem when search fields in word document in c#.

i have following method creates header not exist in word document template.

foreach (headerfooter header in section.headers) {     if(header.exists)     {         lstfields.addrange(header.range.fields.cast<field>());          //gestion des champs dans des formes pour l'entete         foreach (shape shape in header.shapes)         {             try             {                 lstfields.addrange(shape.textframe.textrange.fields.cast<field>());             }             catch (exception)             {                 // ignored             }         }     } } 

any ideas ?

thanks.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -