This code example shows how to insert FormTextInput form fields in word.
The insertion takes place in the example at runtime, programmatically.
A new form field is created via Word.Range.FormFields.Add (..) added
FormField field = act_Image_Range.FormFields.Add(act_Image_Range, WdFieldType.wdFieldFormTextInput); |
Example code in C #
Insert via Word.Range.FormFields.Add (new ..)
//< add textinput field > act_Image_Range.InsertAfter("\n\r"); FormField field = act_Image_Range.FormFields.Add(act_Image_Range, WdFieldType.wdFieldFormTextInput); field.TextInput.EditType(WdTextFormFieldType.wdRegularText); field.OwnStatus = true; field.HelpText = "Bildtext"; field.TextInput.Default = "enter Image-Text"; //</ add textinput field >
|
subject:
Programming in vba, C #
Word ContentControl
Example application
Text input as FormFields type: wdFieldFormTextinput
Subject:
C #, Visual Studio Vsto interop com
FormField, form fields, form input, ContentControls