Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Feb 21, 2017 9:34 am

Hi.
I have a problem with doc.LoadFromFile() method

I tried to load file in different ways, but I got the same result

Code: Select all
Spire.Doc.Document doc = new Spire.Doc.Document(f.FullName, Spire.Doc.FileFormat.Auto);

                //Spire.Doc.Document doc = new Spire.Doc.Document();
                //byte[] fileBytes = File.ReadAllBytes(f.FullName);
                //using (MemoryStream ms = new MemoryStream(fileBytes))
                //{
                //    doc.LoadFromStream(ms, Spire.Doc.FileFormat.Auto);
                //}
               

                foreach (Spire.Doc.Section seс in doc.Sections)
                    if (seс.Tables.Count > 0)
                        GetTablesRecursiv(seс.Tables, NtfNr, f.Name, collection);

                doc.Close();


here the details of exception
HResult=-2146233080
Message=Индекс находился вне границ массива.
Source=Spire.Doc
StackTrace:
в spr☵.ᜀ(Byte[] A_0, Int32 A_1, Int32& A_2)
в sprᤗ.ᜁ(Byte[] A_0, Int32 A_1)
в sprᤗ..ctor(spr♇ A_0)
в sprậ.ᜂ(spr☖ A_0)
в sprậ..ctor(Byte[] A_0, String A_1)
в Spire.Doc.Fields.DocOleObject.ᜀ(Stream A_0)
в sprᨕ.ᜀ(spr‒ A_0, FieldType A_1)
в sprᨕ.ᜀ(spr‒ A_0, sprℹ A_1, String A_2)
в sprᨕ.ᜀ(spr‒ A_0, sprℹ A_1)
в sprᨕ.ᜉ(spr‒ A_0)
в sprᨕ.᜙(spr‒ A_0)
в sprᨕ.ᜀ(spr‒ A_0, Body A_1)
в sprὅ.ᜀ(spr᭯ A_0, Document A_1)
в Spire.Doc.Document.ᜈ(String A_0)
в Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
в Spire.Doc.Document..ctor(String fileName, FileFormat type)

Where can I send a file for testing?
Thank U!
Last edited by RomaA8 on Tue Feb 21, 2017 8:51 pm, edited 2 times in total.

RomaA8
 
Posts: 10
Joined: Fri Feb 17, 2017 11:27 am

Tue Feb 21, 2017 9:41 am

Dear RomaA8,

Thanks for your inquiry.
You can upload the sample file here, or send it to us(support@e-iceblue.com) via email.
And then we will investigate it and update to you.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Feb 21, 2017 8:52 pm

Here is an example

RomaA8
 
Posts: 10
Joined: Fri Feb 17, 2017 11:27 am

Wed Feb 22, 2017 2:11 am

Dear RomaA8,

Thanks for the file.
I have noticed the issue and posted it to our Dev team. We will inform you as soon as there is any progress.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc