Imports Docs.Word



Public Class FormFields_Create
	Friend Shared Function Main1() As Document
		'	Create a new document and get NodeList of first section
		Dim Doc As Document = Document.CreateNew()
		Dim Nodes As NodeList = Doc.Sections(0).Nodes

		'	Enable protection from editing for all sections with enabled protection
		Doc.Properties.DocStatus.ProtectionEnabled = True
		'	Enables protection for the first section of document
		Doc.Sections(0).Style.[Protected] = True

		'	Add checkbox form field which is checked by default
		Nodes.AddParagraph("Some checkbox option:")
		Nodes.AddParagraph().AddFormField_CheckBox("CheckBox 1", True)

		'	Add textbox form field with default text "Hello!" and maximum length of 15
		Nodes.AddParagraph("Some textbox for text input:")
		Nodes.AddParagraph().AddFormField_TextBox("TextBox 1", 15, "Hello!")

		'	Add dropdown list form field with items "Item1", "Item2", "Item3"
		Nodes.AddParagraph("Some dropdown listbox:")
		Nodes.AddParagraph().AddFormField_DropList("DropList 1", "Item1", "Item2", "Item3")
		Return Doc
	End Function
End Class
