TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chetan Allipur
NA
541
167.6k
How to add Appendix in table of contents in word using VSTO.
Jun 12 2017 3:09 AM
How to include appendix in table of contents in word using VSTO.Please anyone send me the code.
Here is my code
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Word.Document doc1 = app.ActiveDocument;
object oMissing = System.Type.Missing;
object oTrue = true;
object ofalse = false;
Selection wordsec = app.Selection;
wordsec.Font.Bold = 1;
wordsec.Font.Size = 14;
wordsec.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
wordsec.TypeText("Appendices\n");
TableOfContents toc= doc1.TablesOfContents.Add(wordsec.Range, ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oTrue,
ref oTrue, ref oMissing, ref oTrue, ref oTrue, ref oTrue);
toc.TabLeader = WdTabLeader.wdTabLeaderDots;
toc.Update();
Microsoft.Office.Interop.Word.Range rngTOC = toc.Range;
rngTOC.Font.Size = 12;
rngTOC.Font.Name = "Arial";
rngTOC.Font.Bold = 0;
if (checkBoxColor.Checked == true)
{
rngTOC.Font.Color = WdColor.wdColorBlue;
}
wordsec.set_Style(WdBuiltinStyle.wdStyleNormal);
this.Hide();
Reply
Answers (
0
)
how to add discount column in gridview c# windows form
How to generate bill number show in Textbox from database c