chetan Allipur

chetan Allipur

  • NA
  • 541
  • 168.8k

How to set the font color blue to Table of contents.

Jul 24 2017 3:34 AM
 How to set the font color blue and Indent to Table of contents using word VSTO
 
Here is my code.
 
Microsoft.Office.Interop.Word.TableOfContents toc = doc1.TablesOfContents.Add(wordsec.Range, ref otrue, ref oUpperHeadingLevel, ref oLowerHeadingLevel, ref missing,
ref missing, ref otrue, ref otrue, ref otrue, ref otrue, ref otrue, ref ofalse);
toc.TabLeader = WdTabLeader.wdTabLeaderDots;
toc.Update();
Microsoft.Office.Interop.Word.Range rngTOC = toc.Range;
if (checkBoxColor.Checked == true)
{
rngTOC.Font.Color = WdColor.wdColorBlue;
}
wordsec.set_Style(WdBuiltinStyle.wdStyleNormal);
this.Hide();
 

Answers (1)