We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regarding Saving Document

Thread ID:





74882 Jul 2,2008 05:38 AM UTC Jul 1,2009 12:03 PM UTC WinForms 3
Tags: DocIO
Asked On July 2, 2008 05:38 AM UTC

I want to store the empty document but when i save the document it gives the error. i m using following code:

Dim document As WordDocument = New WordDocument()
document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc)

I got following error:

Index was out of range. Must be non-negative and less than the size of the collection.

Can you plz guide me how to resolve this issue.


Gurpeet Madaan

Bhuvaneswari P [Syncfusion]
Replied On July 2, 2008 05:46 AM UTC

Hi Gurpreet,

Thank you for your interest in Syncfusion products.

When we create a new empty document. It doesn't have any section or paragraphs, so it throws an error. To avoid this Call EnsureMinimal method, this will add one empty section and one empty paragraphs. Please refer the below code snippet:


Dim document As WordDocument = New WordDocument()
document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc)

'Adds one empty section to the document and one empty paragraph to created section.

Please try this and let me know if this helps you.

Best Regards,

Administrator [Syncfusion]
Replied On June 30, 2009 12:17 PM UTC

I have had this same problem. After some trial and error approaches, I discovered that one field in the DataRow was causing the problem.

This field contained the text "H. " (including the space at the end).

When I removed the space, the problem was solved. As a work-around, I have now made sure that all fields of type string are trimmed before feeding it to DocIO, which solved the problem.

Sri Subhashini M [Syncfusion]
Replied On July 1, 2009 12:03 PM UTC

Hi Michael,

Sorry for the inconvenience caused.

Could you please share us with sample code snippet or stack trace of the exception so that we could analyze the issue in depth and provide you the better solution?



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon