dimanche 18 août 2019

Auto Break between Checkbox and Text in C#

I hope you can help me with my problem.

I want to automatically generate a Word checklist with a C# program.

But I can't get it to put the text behind the checkbox. The text always lands in a new line under the checkbox.

How can I solve this problem?

You know some other functions?

    public void createChecklist()
    {
        Application app = new Application();
        app.Visible = true;
        Document doc = app.Documents.Add();
        Paragraph para = doc.Paragraphs.Add();

        ContentControl checkbox = para.Range.ContentControls.Add(WdContentControlType.wdContentControlCheckBox);
        para.Range.InsertAfter("sdjsakd");

        doc.SaveAs2("C:\\tmp\\checklist.docx");
        app.Quit();

    }

Word




Aucun commentaire:

Enregistrer un commentaire