'''' 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 an AUTONUM (Automatic Numbering) field to a Word document,'' and specify its options.PublicClassAutoNumFieldOptsFunctionCreateDocx() AsGcWordDocumentDim doc = NewGcWordDocument() Dim options = NewAutoNumFieldOptions(doc) Dim p AsParagraph = doc.Body.AddParagraph("Heading 1", doc.Styles(BuiltInStyleId.Heading1)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 2", doc.Styles(BuiltInStyleId.Heading2)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 2", doc.Styles(BuiltInStyleId.Heading2)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 3", doc.Styles(BuiltInStyleId.Heading3)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 3", doc.Styles(BuiltInStyleId.Heading3)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 1", doc.Styles(BuiltInStyleId.Heading1)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) p = doc.Body.AddParagraph("Heading 2", doc.Styles(BuiltInStyleId.Heading2)) p.GetRange().ComplexFields.Insert(options, InsertLocation.Start) doc.UpdateFields(NewGrapeCity.Documents.Word.Layout.WordLayoutSettings() With { .FontCollection = Util.FontCollection, .Culture = CultureInfo.GetCultureInfo("en-US") }) Return docEndFunctionEndClass