adamrossnelson/conrpt

PDX Option

Closed this issue · 1 comments

Code that will support putting multiline macro in putdocx.

===============================================================
local sl = char(10)              // Define line return.

local oneliner "THIS IS ONE LINE OF TEXT IN A MARCRO - GOES TO PUTDOCX FILE"

local multiliner "THIS WILL BE MULTIPLE LINES`sl'" ///
"HERE IS A SECOND LINE OF TEXT`sl'" ///
"AND NOW A THIRD LINE OF TEXT`sl'" ///
"FINALLY A LAST LINE"

// Display the one liner as output.
di "`oneliner'"

// Display the multi liner as output.
di "`multiliner'"

capture putdocx clear
putdocx begin
putdocx paragraph, font(Consolas)
putdocx text ("`oneliner'")

putdocx paragraph, font(Consolas)
foreach line in "`multiliner'" {
        putdocx text ("`line'"), linebreak
}
putdocx save needs_help.docx, replace
===============================================================

Finalized pdx option. Completed pull request.