10-06-2014 05:36 AM
I have a Mail Merge Word Template for a sales order that reads in fields from Opportunity Product which includes a list of products on the opportunity.
The problem occurs when I try and export a memo field into a grid/table into the document. If the field contains carriage returns [ char(13) ] the table becomes a mess because it treats each paragraph of the memo field as a new cell.
I've tried replacing Char(13) with Char(10) and Char(11) [soft-return] but the next row still starts at the first column of the grid instead of following the description column.
Sadly I need the format of this template specific to an existing document and this format won't do.
I've found an article on crm.ittoolbox. com which describes the same issue in 2010 but with no fix.
Has anyone found a get-around?
10-06-2014 05:43 AM
Wouldn't the replacement be chr(13) + chr(10) ? (CR+LF) [as chr(11) is a vertical tab.
string = string + chr(13) + chr(10)
10-06-2014 05:58 AM
Thanks for replying Mike,
I get the same result with replace(string, chr(10),chr(13)+chr(10)) where the column structure is being lost on merge.
Instead of following the column format it jumps to the first column on line break or carriage return or any combination of both. The format overflows correctly when they are replaced with ' '.
See this screenshot to see what I mean...
10-06-2014 08:10 AM
If you replace char(10) + Char(13) with a tilde (~) Then, through Word perform a Find & Replace on '~' with '^p' this will introduce a carriage return on that character which is precisely what I require...Unfortuantely I cannot find a way to invoke Find and Replace automatically in the Word embedded into SLX.
10-08-2014 06:36 AM
Wrote the table directly into Word through vbscript and the column format was still broken at the CR/LF, giving up and writing a button to launch a .net report instead.