Actually current i am working on a project that needs to import /export/manage a very large word document in Rich Text Editor.
In this project user imports a word document of approx. 50 pages and then make some changes and the it saved to sql server database.
Now user can load it from database and further make some changes and again saved to database.
On importing the large word document it successfully imported in Rich Text Editor but after making some changes,
when i export it to a file then got the error "object reference not set to an instance of object".
Export functionality is working fine for small documents(approx 10 pages).
I am using this code.
Dim pathSource As String = Application.StartupPath & "\FileName.docx"
Using fsSource As Stream = New FileStream(pathSource, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, Int32.MaxValue, True)
provider.Export(document, fsSource): '(error raised after executing this line of code.)
Dim docByte As Byte() = New Byte(fsSource.Length - 1) {}
fsSource.Read(docByte, 0, System.Convert.ToInt32(fsSource.Length))
fsSource.Close()
SaveFileToDatabase(docByte)
End Using
Please help....
Regards,
Panch Raj