Dropdown for bookmark like word file

I have a question. Can we implement a dropdown for the bookmark, similar to what we do in a Word file, using .NET Core and GemBox?

Like This:
image

Hi Taher,

Can you send us your Word file so that we can investigate it?

If that is an ActiveX control, I’m afraid that GemBox.Document doesn’t have API support for them.

Regards,
Mario

there is no option to attach file here.
This is a bookmark
When I click on this, it will show options like this:

You can send us a file via email or support ticket.
See the Contact page.

This structure can be implemented with GemBox.Document, it’s a FORMDROPDOWN field wrapped inside a bookmark and a REF field that is referencing that same bookmark.

Here is a small sample that recreates this:

var document = new DocumentModel();
var section = new Section(document);
document.Sections.Add(section);

var formDropDownField = new Field(document, FieldType.FormDropDown);
var formDropDownData = formDropDownField.FormData as FormDropDownData;
formDropDownData.Name = "My_DropDown_Bookmark";
formDropDownData.CalculateOnExit = true;
formDropDownData.Items.Add("Item 1");
formDropDownData.Items.Add("Item 2");
formDropDownData.Items.Add("Item 3");

section.Blocks.Add(
    new Paragraph(document,
        new BookmarkStart(document, formDropDownData.Name),
        formDropDownField,
        new BookmarkEnd(document, formDropDownData.Name)));

section.Blocks.Add(new Paragraph(document, "-----------------"));

section.Blocks.Add(
    new Paragraph(document,
        new Field(document, FieldType.FormText, null, new string('\x2002', 5))
        { FormData = { Name = "My_TextBox" } }));

section.Blocks.Add(new Paragraph(document, "-----------------"));

var refField = new Field(document, FieldType.Ref, "My_DropDown_Bookmark", formDropDownData.ValueOrDefault);

section.Blocks.Add(
    new Paragraph(document,
        new Run(document, "Text that changes based on FormDropDown: "),
        refField));

document.Protection.StartEnforcingProtection(EditingRestrictionType.FillingForms, "password");

document.Save("output.docx");

Regards,
Mario