Free Support Forum - aspose.com

Floating textbox in source .docx appears to corrupt output .doc

I have a problem with a source .docx file, containing a simple floating textbox anchored between images that are inserted by Aspose, when outputing to .doc

The .doc file is output by Aspose without any errors, however when the resulting document is edited and saved and then re-opened Word claimes the document is corrupt (see attached screenshot). Applying the same edits to the source document results in a good document.

I am running Aspose 8.2, Word 2007

Replicating the issue:

1. Use the uploaded document bug.docx and the uploaded image test.jpg along with the code shown below.

2. Run the code to generate bugout.doc

3. Open bugout.doc in Word, move to the end of the document and add a drawing canvas, then draw 5 or more lines on the drawing canvas.

4. Save the document

5. Open the document again- document is corrupt.

Code:

Sub bug()

Try

'

' get Aspose licence

'

Dim license As Aspose.Words.License = New Aspose.Words.License()

license.SetLicense("E:\Aspose.Words.lic")

'

' Get master document (the first one in the list)

'

Dim doc As Aspose.Words.Document = New Document("E:\bug.docx")

Dim builder As DocumentBuilder = New DocumentBuilder(doc)

Dim bookmarks As BookmarkCollection = doc.Range.Bookmarks

For Each bookmark As Bookmark In bookmarks

builder.MoveToBookmark(bookmark.Name)

builder.InsertImage("E:\test.jpg", 100, 100)

Next

'

' Save document

'

doc.Save("E:\bugout.doc")

Catch ex As Exception

MsgBox(ex.ToString)

End Try

End Sub

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. We will deeply investigate the issue and provide you more information.

Best regards,

The issues you have found earlier (filed as WORDSNET-3271) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.