Contenuto principale

mlreportgen.dom.enableDOCXUpdateOnOpen

Display dialog box when DOCX document opens

Since R2022b

    Description

    mlreportgen.dom.enableDOCXUpdateOnOpen(option) specifies whether to display a dialog box when you open a programmatically generated DOCX document. The dialog box opens and prompts you to update the document fields when you manually open the document or when you use the rptview function to open the document, but the function cannot update the document fields.

    example

    Examples

    collapse all

    This example shows how to enable the display of a dialog box and update document fields when you programmatically generate a DOCX report and manually open the report.

    Enable the display of the dialog box. Then, add a table of contents to a document and specify one heading level.

    import mlreportgen.dom.*
    
    enableDOCXUpdateOnOpen(true);
     
    rpt = Document("Report with update fields enabled","docx");
     
    append(rpt,TOC);
    append(rpt,Heading1("Chapter 1"));
    append(rpt,"Chapter 1 content");
      
    close(rpt);

    Manually open the DOCX report. Microsoft® Word displays the dialog box before opening the document.

    The dialog box prompt

    Input Arguments

    collapse all

    Whether to display a dialog box that prompts you to update the document fields, specified as a logical 1 (true) or 0 (false). When you specify:

    • 1 (true) — Display the dialog box.

    • 0 (false) — Do not display the dialog box.

    Data Types: logical

    Version History

    Introduced in R2022b