14
Views
6
Comments
Solved
[MSWordUtils] Create Document using Docx extension
mswordutils
Web icon
Forge asset by Stuart Harris
Application Type
Reactive

Hello, 

I am using Docx extension to create a word document . I need to create a document in the below format 

A list with subpoints in it (with no bullet points)

Thanks,

Asiyah


2025-08-07 06-30-56
Amit J
Champion
Solution

See this one  
https://amitj.outsystemscloud.com/MSWordUtils_Sample/Sample.aspx?_ts=638917292405086427

Use 

NewLine()+ Chr(9)+ "subline for line 2" for the subline 

https://amitj.outsystemscloud.com/MSWordUtils_Sample/Sample.aspx


 Please find oml with Sample page. Let me know if its not helpful.

MSWordUtils_Sample.oml
2025-08-07 06-30-56
Amit J
Champion

So you can use Chr(9) to add tab with in any string. See the url and oml and let me know in case of any help

2023-10-27 12-06-14
Asiyah Munawwar

Although the above solution is creating tab but if the sublines are larger then this solution isnt working as i need to again add chr(9) in between to create tabs

Sharing ss:


2025-08-07 06-30-56
Amit J
Champion

Since there’s no direct option available, we’ll need to split the long string by character length and build it step by step, for example:

H1 Generates a document and inserts a list" + NewLine() +Char(9) + "Subline for Line" + NewLine() +Char(9) + "2nd Subline for H1

Meanwhile, I’ll also check if another approach is possible.


2025-08-07 06-30-56
Amit J
Champion

Hi 
Approach that you can do if text is fixed.
 Using Docx Template (Recommended)

  1. Create a Word Template (.docx) with:

    • H1 and H2 headings using Word styles.

    • Sub-lines as plain text (do not apply bullet or numbering).

  2. In OutSystems:

    • Use GenerateDocxFromTemplate action from the Docx extension.

    • Pass your data in a JSON structure.

  3. Ensure your template uses placeholders like:


    ${Heading1}

         ${Subline1}

         ${Subline2}

    ${Heading2}

         ${Subline1}

         ${Subline2}

    and replace these placeholders with the dynamic text. 

    let me know if text have dynamic and no predefined format.

2023-10-27 12-06-14
Asiyah Munawwar

Hi Amit,

Thankyou for helping me out . 

I dont want to use the template as 

I am having dynamic list and  sublist .

I dont have a predefined static format .There could be other text in the document based on the user's input .


Thanks

 

2025-08-07 06-30-56
Amit J
Champion
Solution

See this one  
https://amitj.outsystemscloud.com/MSWordUtils_Sample/Sample.aspx?_ts=638917292405086427

Use 

NewLine()+ Chr(9)+ "subline for line 2" for the subline 

https://amitj.outsystemscloud.com/MSWordUtils_Sample/Sample.aspx


 Please find oml with Sample page. Let me know if its not helpful.

MSWordUtils_Sample.oml
2025-08-07 06-30-56
Amit J
Champion

So you can use Chr(9) to add tab with in any string. See the url and oml and let me know in case of any help

2023-10-27 12-06-14
Asiyah Munawwar

Although the above solution is creating tab but if the sublines are larger then this solution isnt working as i need to again add chr(9) in between to create tabs

Sharing ss:


2025-08-07 06-30-56
Amit J
Champion

Since there’s no direct option available, we’ll need to split the long string by character length and build it step by step, for example:

H1 Generates a document and inserts a list" + NewLine() +Char(9) + "Subline for Line" + NewLine() +Char(9) + "2nd Subline for H1

Meanwhile, I’ll also check if another approach is possible.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.