chetan Allipur

chetan Allipur

  • NA
  • 541
  • 158.3k

How to get the Appendix Style like Table of Contents in VSTO

Jul 24 2017 9:26 AM
How to get the Appendix Style like Table of Contents in VSTO word.
 
Here I tried
 
try
{
object oMissing = System.Type.Missing;
object oTrue = true;
object ofalse = false;
wordsec.Font.Bold = 1;
wordsec.set_Style(WdBuiltinStyle.wdStyleTitle);
wordsec.TypeText("List of Appendices\r\n");
TableOfFigures toa = doc1.TablesOfFigures.Add(wordsec.Range, ref oMissing, ref ofalse, ref ofalse, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oTrue, ref oTrue,
ref ofalse, ref oTrue, ref oTrue);
//Microsoft.Office.Interop.Word.TableOfContents toa = doc1.TablesOfContents.Add(wordsec.Range, ref ofalse, ref oMissing, ref oMissing, ref ofalse,
// ref oMissing, ref oTrue, ref oTrue, ref oTrue, ref oTrue, ref ofalse, ref oTrue);
short num1 = 2;
toa.HeadingStyles.Add("Appendix", num1);
toa.Update();
ResetTOCStyles(DEF_INDENT1);
ResetTandFStyles(CTD_INDENT_TAB, CTD_INDENT_FIG);
wordsec.set_Style(WdBuiltinStyle.wdStyleNormal);
this.Hide();
}
catch (Exception ex)
{
throw ex;
}
 
 
Please anyone help me