Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Rich field data to maintain formatting with Word Doc Mail Merge
    text
    copied!<p>I built a SOW template generator that replaces a Word Doc's Mail Merge fields with Rich Text (using html markup) content from associated database fields. Everything works as intended but I'm running into a few issues trying to get the formatting to look right.</p> <p>My two main issues were bullet points and word wrap on lists. </p> <p>To get the bullet point style I need, Word actually uses an 'o' and specifies 'courier new' as the font. I can't specify the font because word will always override with the doc styles.</p> <p>Word doesn't seem to honor list items when it does the merge so once text hits the edge of the doc it starts from the far left of the doc rather than tabbed for the bullet. The page source generated when word is converted to html has a specific style and ID for every list and level. I tried using the inline styling equivalents to get the wrap effect but it did not work.</p> <p>Anyone have advice on how to correctly style these elements so Word will honor the formatting?</p> <p>Here is an example of my markup that retains formatting the best so far:</p> <pre><code>&lt;p style="margin:0;"&gt;Here is a bunch of random text:&lt;/p&gt; &lt;p style="margin:0 0 0 1in;"&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Executive Summary&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Here is a lot more random text and stuff. Super fun.&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;More superfluous stuff. If I knew Latin I would do that instead.&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Summarized steps of nonsense.&lt;/p&gt; &lt;p style="margin:0 0 0 1in;"&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Stuff Description&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Description of the stuff and how the stuff was suppose to to meet the needs of the peoples in the places.&lt;/p&gt; &lt;p style="margin:0 0 0 1in;"&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Reporting and stuff&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Description of blah blah etc and more stuff. This is a lot of useless text.&lt;/p&gt; &lt;p style="margin:0 0 0 1in;"&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Scope of stuff and methodlogy of stuff&lt;/p&gt; &lt;p style="margin:0 0 0 1in;"&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Findings and Recommendations of stuff&lt;/p&gt; &lt;p style="margin:0 0 0 1.75in;text-indent:-.25in;"&gt;&lt;span style="font-family: Courier New; mso-fareast-font-family: Courier New;"&gt;o&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Scoring stuff and making sure people got the right stuff for the stuff. Keeping the stuff safe one day at a time. yay.&lt;/p&gt; &lt;p style="margin:0;"&gt;Appendices: I had enough of this stuff so I'm going to stop typing.&lt;/p&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload