'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.GlobalizationImportsGrapeCity.Documents.WordImportsGrapeCity.Documents.Word.Fields '' This sample shows how to add a LISTNUM (List Number) field to a Word document,'' and specify its options.PublicClassListNumFieldOptsFunctionCreateDocx() AsGcWordDocumentDim doc = NewGcWordDocument() Dim listName AsString = "MyList" doc.ListTemplates.Add(BuiltInListTemplateId.OutlineLegal, listName) Dim options = NewListNumFieldOptions(doc) With { .Name = listName, .Level = 1 } Dim table AsTable = doc.Body.AddTable(NewString()() {NewString() {"Step", "Description"},NewString() {Nothing, "Open the Settings menu."},NewString() {Nothing, "Select ""Preferences"" from the list."},NewString() {Nothing, "Click ""Save"" to apply changes."} }, doc.Styles(BuiltInStyleId.GridTable1Light)) table.Format.StyleOptions = table.Format.StyleOptionsOrTableStyleOptions.FirstRow table(1, 0).GetRange().Paragraphs.First.GetRange().ComplexFields.Add(options) table(2, 0).GetRange().Paragraphs.First.GetRange().ComplexFields.Add(options) table(3, 0).GetRange().Paragraphs.First.GetRange().ComplexFields.Add(options) doc.UpdateFields(NewGrapeCity.Documents.Word.Layout.WordLayoutSettings() With { .FontCollection = Util.FontCollection, .Culture = CultureInfo.GetCultureInfo("en-US") }) Return docEndFunctionEndClass