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
169k
How to do custom Numbering list in word using VSTO.
Jun 19 2017 6:22 AM
Here is for Number list
object missing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Word.Document doc1 = app.ActiveDocument;
app.Visible = true;
// whatever is selected will be turned into a numbered list.
object n = 1;
ListTemplate template =
app.ListGalleries[WdListGalleryType.wdOutlineNumberGallery].ListTemplates.get_Item(ref n);
Microsoft.Office.Interop.Word.ListLevel level = template.ListLevels[1];
level.NumberFormat = "%1.";
level.TrailingCharacter = WdTrailingCharacter.wdTrailingTab;
level.NumberStyle = WdListNumberStyle.wdListNumberStyleArabic;
level.NumberPosition = app.InchesToPoints(0.25f);
level.Alignment = WdListLevelAlignment.wdListLevelAlignLeft;
level.TextPosition = app.InchesToPoints(0.35f);
level.TabPosition = (float)WdConstants.wdUndefined;
level.ResetOnHigher = 0;
level.StartAt = 1;
level.LinkedStyle = "";
template.Name = "";
object bContinuePrevList = true;
object applyTo = WdListApplyTo.wdListApplyToSelection;
object defBehavior = WdDefaultListBehavior.wdWord10ListBehavior;
app.Selection.Range.ListFormat.ApplyListTemplateWithLevel(
template, ref bContinuePrevList,
ref applyTo, ref defBehavior, ref missing);
But I want for all Alphabelet list, bullet, and Roman. If I use sub lists it should work. Please any can send me the code for other list its urgent for me now
Reply
Answers (
4
)
Incorrect syntax near '0'. in Sql Server windows application
How to draw z - axis using C#.net in windows application