Can't load the file error "There are too many styles in the document."

Hi
When I try to load the file, the component ASPOSE.WORD given this error:

The document appears to be corrupted and cannot be loaded.
{“There are too many styles in the document.”}

Someone, can help me, I’m using version 19.6.0.0

@tecnologia-info_poder-judicial_go_cr

Please ZIP and attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.

Thanks,
I attached the RTF document
documentoRTF.zip (77.1 KB)

this is what we do in source code:
Using outStream As New MemoryStream()

            Dim docrtf As Aspose.Words.Document = New Aspose.Words.Document(DocFirmarRTF)
            output = docrtf.Save(outStream, SaveFormat.Doc)
            docBytes = outStream.ToArray()
            docrtf = Nothing
        End Using

Then this is the error:
The document appears to be corrupted and cannot be loaded.

@tecnologia-info_poder-judicial_go_cr,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18765. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Thank you a lot. I hope to heard from you soon.

Hello,

We also have this other problem when it is converted to RTF generates an error:

No se puede convertir un objeto de tipo ‘Aspose.Words.Style’ al tipo ‘Aspose.Words.TableStyle’.
The source code is this and the file for testing: documento.zip (84.9 KB)

'Conversion ASPOSE
Dim docBytes() As Byte = Nothing
Dim output As Aspose.Words.Saving.SaveOutputParameters = Nothing
Dim documento As Aspose.Words.Document
Using outStream As New MemoryStream()
Dim docrtf As Aspose.Words.Document = New Aspose.Words.Document(“D:\documentoRTF.rtF”)
output = docrtf.Save(outStream, SaveFormat.Doc)
docBytes = outStream.ToArray()
docrtf = Nothing
End Using
Dim patternVoto As String = “<A_Numerovotoautomatico([(-)r1])>”
Dim pNumeroVoto As String = “2009-ESTOY-MODIFICADO”
Using inStream As New MemoryStream(docBytes)
documento = New Aspose.Words.Document(inStream)
'Poner el numero de voto al documento
If Not String.IsNullOrEmpty(pNumeroVoto) Then
Dim _tagRegexVoto = New Regex(patternVoto)
Dim ExcluirDocumento As Boolean = False
'Buscar donde poner numero de voto
ExcluirDocumento = documento.Range.Replace(_tagRegexVoto, String.Format(" N° {0}", pNumeroVoto)) = 0
End If
'Crea el documento rtf - HERE IS THE ERROR.
output = documento.Save(“D:\documentoRTF.rtf”, SaveFormat.Rtf)
End Using

@tecnologia-info_poder-judicial_go_cr,

While using the latest version of Aspose.Words i.e. 19.6, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-18769. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

1 Like

The issues you have found earlier (filed as WORDSNET-18769,WORDSNET-18765) have been fixed in this Aspose.Words for .NET 19.7 update and this Aspose.Words for Java 19.7 update.

Yes, that’s correct.
I have reviewed everything and it works very well. I appreciate all your help regarding this matter
Poder Judicial Costa Rica.