I started by loading the MemoryStream from a text field containing the HTML string and trying to save it to disk as a test.
- Code: Select all
MemoryStream memstreamOriginal = new MemoryStream();
byte[] arrByteDataHTML = new byte[lblHTML.Text.ToString().Length];
Document docx = new Document();
memstreamOriginal.Write(arrByteDataHTML,0,arrByteDataHTML.Length);
docx.LoadFromStream(memstreamOriginal, FileFormat.Html);
docx.SaveToFile(strFileName, FileFormat.Html);
I received this error.
- Code: Select all
A first chance exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll
The element 'html' in namespace 'http://www.w3.org/1999/xhtml' has incomplete content. List of possible elements expected: 'http://www.w3.org/1999/xhtml:body'.
This is the HTML code
- Code: Select all
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="Narrative2_files/filelist.xml">
<link rel=Edit-Time-Data href="Narrative2_files/editdata.mso">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceName"/>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>0</w:Zoom>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
st1\:*{behavior:url(#ieooui) }
st1\:*{behavior:url(#ieooui) }
st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:Arial;
mso-fareast-font-family:Arial;}
h1
{mso-style-next:Normal;
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
font-family:Arial;
mso-fareast-font-family:Arial;
mso-font-kerning:16.0pt;}
@page Section1
{size:8.5in 11.0in;
margin:.5in 54.7pt .5in 54.7pt;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--><OBJECT id=ieooui classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D></OBJECT><OBJECT id=ieooui classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D></OBJECT><OBJECT id=ieooui classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D></OBJECT>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal>AB 1653 (Chapter 218, Statutes of 2010) revises the Medi-Cal
hospital provider fee and supplemental payments enacted by AB 1383 (Chapter
627, Statutes of 2009).<span style='mso-spacerun:yes'> </span>AB 1653
alters the methodology, timing, and frequency of supplemental payments,
increases capitation payments, and increases payments to mental health
plans.<span style='mso-spacerun:yes'> </span>AB 1653 allows the
Department to proceed with implementing the Quality Assurance Fee (QAF) once a
letter indicating likely federal approval has been received.<span
style='mso-spacerun:yes'> </span>AB 1653 also allows the State to retain
up to $420 million from the portion of the Hospital Quality Assurance Revenue
Fund (HQARF) (Item 4260-610-3158) set aside for direct grants to designated
public hospitals for the State’s use while the bill is in effect.<span
style='mso-spacerun:yes'> </span>In exchange, a portion of federal
flexibility funding would be allocated to the designated public hospitals and
be identical in amount to the sum retained by the State from the QAF fund.<span
style='mso-spacerun:yes'> </span>The Department would claim these federal
funds upon receipt of the necessary expenditure reports and certifications from
the public hospitals, and would distribute those funds in conformity with the <st1:place
w:st="on"><st1:PlaceName w:st="on">QAF</st1:PlaceName> <st1:PlaceType w:st="on">Hospital</st1:PlaceType></st1:place>
payment schedule.<span style='mso-spacerun:yes'> </span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>This policy change reflects the retention of the $420
million from the HQARF fund by the State and the payment of $420 million in
federal flexibility funds to the DPHs for their CPEs.<span
style='mso-spacerun:yes'> </span>The retention and the payments were both
completed in December 2010.<span style='mso-spacerun:yes'> </span>Other
supplemental payments authorized by AB 1383 and AB 1653 are shown in a separate
PC.<span style='mso-spacerun:yes'> </span>The funding adjustment is
reflected in the management summary.<span style='mso-spacerun:yes'>
</span></p>
<p class=MsoNormal><o:p> </o:p></p>
<div align=center>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
style='border-collapse:collapse;mso-yfti-tbllook:480;mso-padding-alt:0in 2.15pt 0in 2.15pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width=106 valign=bottom style='width:1.1in;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'>FY 2010-11<o:p></o:p></b></p>
</td>
<td width=115 valign=bottom style='width:1.2in;border:none;border-bottom:
solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'>TF<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p>
</td>
<td width=125 valign=bottom style='width:1.3in;border:none;border-bottom:
solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'>GF<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p>
</td>
<td width=115 valign=top style='width:1.2in;border:none;border-bottom:solid windowtext 1.0pt;
mso-border-bottom-alt:solid windowtext .5pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'>Hosp. QA Rev. Fund<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p>
</td>
<td width=115 valign=bottom style='width:1.2in;border:none;border-bottom:
solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=center style='text-align:center'><b
style='mso-bidi-font-weight:normal'>FF<o:p></o:p></b></p>
</td>
</tr>
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
<td width=106 valign=top style='width:1.1in;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p> </o:p></b></p>
</td>
<td width=115 style='width:1.2in;border:none;mso-border-top-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'>$420,000,000<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'><o:p> </o:p></b></p>
</td>
<td width=125 style='width:1.3in;border:none;mso-border-top-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'>$-420,000,000<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'><o:p> </o:p></b></p>
</td>
<td width=115 style='width:1.2in;border:none;mso-border-top-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'>$420,000,000<o:p></o:p></b></p>
</td>
<td width=16 valign=top style='width:11.8pt;padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'><o:p> </o:p></b></p>
</td>
<td width=115 style='width:1.2in;border:none;mso-border-top-alt:solid windowtext .5pt;
padding:0in 2.15pt 0in 2.15pt'>
<p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
normal'>$420,000,000<o:p></o:p></b></p>
</td>
</tr>
</table>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>
How do I go about doing a complete HTML-to-WORD conversion and edit using MemoryStream as a conduit and calling your library functions?
Thank You
arrell