Dealing with a general docx file, especially one produced by Word, is difficult because Microsoft don't follow their own specs in all cases. Usually, most specific cases are easier - it's perfectly possible to produce valid, well formatted docx documents using e.g. Template::Toolkit and Archive::Zip, since docx files are just zipped xml at heart.
I have no knowledge of SQL Server BLOB formats, but it might be worth trying to unzip the .docx file you produce to see if:-
- It's a valid zip file.
- It contains stuff that looks like xml
If it doesn't look anything like a zip file, you probably need to do some more processing on the BLOB before writing it to file; if it looks docx-ish, you just have to work out what changes you need to make Word eat it.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.