Problem converting documents from WORD format to HTML format (Second Request)


#1

I posted another support request earlier today this one is for a different issue I got when converting a WORD document to HTML format.

Here is the code sample:

Dim l_doc As Aspose.Word.Document
l_doc = New Aspose.Word.Document(p_full_file_name)
l_doc.Save(p_new_full_file_name, Aspose.Word.SaveFormat.FormatHtml)

When I run it against the Attached Word document, I get the exception:

-Object reference not set to an instance of an object.

The paragraph that is invalid in my word document contains a BOOKMARK. The bookmark contains a PARAGRAPH at the end of it and if I remove the paragraph it converts correctly. However, the conversion process runs as a service in our environment and I would like this kind of word document to convert without exception.

The version of Aspose we are using is 3.2.2 but I download the most recent version from your web site today and I still have the same problem.

Thanks for your assistance again...


#2

Your paragraph actually contains not only a bookmark but a text form field which uses this bookmark for naming. The form field, in turn, contains another paragraph of text.

I'm not sure what it is supposed to look like in the resulting HTML document, but I have slightly remade the document to avoid the error. Please find attached. Does it suit you?


#3

The other problem I reported wit conversion to HTML has been resolved with the HotFix 3.3.1, this one is still occuring. Do you have an idea when this one will be resolved?


#4

Give me 2-3 days please.


#5

The problem is caused by a text input form field that contains a paragraph mark. Aspose.Word tries to export a text input form field as an INPUT HTML element and falls over on one with a paragraph mark. I will fix that in the next few days, but you can proceed if you set:

Document.SaveOptions.HtmlExportTextInputFormFieldAsText = true;

This is a good option in your case I think, you probably don't want that text to appear in an INPUT control in the resulting HTML.