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.7k
How to Insert the TableOfFigures in word using VSTO.
Jun 5 2017 2:07 AM
Please anyone tell me How to Insert the TableOfFigures in word using VSTO. I am doing my own so please anyone send me the code.
For TableOfContents I did. I want TableOfFigures
fore TableOfContents here my code.
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Word.Document doc1 = app.ActiveDocument;
object val1 = comboBox1.SelectedItem;
object oUpperHeadingLevel = "1";
object oLowerHeadingLevel = val1;
object missing = null;
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("Table of Contents\n");
TableOfContents toc = doc1.TablesOfContents.Add(wordsec.Range, ref otrue, ref oUpperHeadingLevel, ref oLowerHeadingLevel, ref ofalse, ref missing,
ref otrue, ref otrue, ref missing, ref otrue, ref ofalse, ref ofalse);
Microsoft.Office.Interop.Word.Range rngTOC = toc.Range;
rngTOC.Font.Size = 12;
rngTOC.Font.Name = "Arial";
rngTOC.Font.Bold = 0;
wordsec.set_Style(WdBuiltinStyle.wdStyleNormal);
this.Hide();
Reply
Answers (
0
)
How to display "loading" spinner while a query is executing
How should be the Resource Names?