c# 4.0 - ActiveDocument.Fields.Update() doesn't update TOC code -


i want update fields of toc in word document using below code.

activedocument.fields.update(); activedocument.undoclear();

with code fields of toc not updating. manually selecting document content pressing f9 update fields, including toc. have tried below code snippet update toc fields.

foreach (tableofcontents tableofcontents in activedocument.tablesofcontents) {  tableofcontents.update(); tableofcontents.updatepagenumbers(); }  foreach (tableoffigures tableoffigures in activedocument.tablesoffigures) { tableoffigures.update(); } foreach (range storyrange in activedocument.storyranges) { storyrange.fields.update(); } 

toc fields not updated above code snippet. there other ways update toc fields. can me on this.

thanks, gayatri


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -