We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Attach a rtf file to a docx

We are using Aspose.Words.dll (vers.13.1)
We have a process to merge a document with bookmarks, and insert documents. RTF inside.

The RTF document is correct, but when inserted into the document. docx, the rows are clipped.

Attach template (plantilla.docx), File to Insert (FileToInsert.rtf) and the result of the merge file (FileResult.docx)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />



Code that makes the call to the merge:


'Method that assigns the format and make the object oDocBuilder

Private Sub OpenDocument()

Dim ms As System.IO.MemoryStream

If m_eTypeFiles = eTypeFiles.BytesInput_BytesOutput Or m_eTypeFiles = eTypeFiles.BytesInput_PhysicOutput Then

ms = New System.IO.MemoryStream(m_oBytesFileIn)

m_oDoc = New Aspose.Words.Document(ms)

ElseIf m_eTypeFiles = eTypeFiles.PhysicInput_BytesOutput Or m_eTypeFiles = eTypeFiles.PhysicInput_PhysicOutput Then

m_oDoc = New Aspose.Words.Document(m_sPathFileIn)

End If

m_oDocBuilder = New Words.DocumentBuilder(m_oDoc)

If m_oDoc.OriginalLoadFormat = Words.LoadFormat.Docx Then

m_sExtDocument = ".docx"

ElseIf m_oDoc.OriginalLoadFormat = Words.LoadFormat.Odt Then

m_sExtDocument = ".odt"

End If

End Sub

'Method that invokes the method Accept DocumentBuilder class

Public Function PutFusion() As List(Of String) Implements IFusion.PutFusion


For iCont = 0 To m_oMainData.Values - 1

oclsDocInspector = New DocInspector(m_oDocBuilder, m_oMainData, iCont)

m_oDoc.Accept(oclsDocInspector) 'At this point we invoke the Aspose.Words methods for fusion

Me.Save()'At this point, save the file "result" of the fusion


End function

‘Within DocInspector.vb ... enters this method to insert the file into the docx rtf

Private Sub ReplaceBookmarkWithDocument(ByVal sPathFile As String)

Dim oDocCos = New Document(sPathFile)

Dim oBk As Aspose.Words.Bookmark = m_oDocBuilder.Document.Range.Bookmarks(m_oBookmark.Name)

oBk.Text = ""


Dim insertAfter As Section = m_oDocBuilder.CurrentSection


m_oDocBuilder.Document.FirstSection.PageSetup.SectionStart = SectionStart.Continuous

appendDocumentAfterSection(oDocCos, insertAfter)

End Subv

Hi Francesc,

Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-8239. 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.

Best regards,

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

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

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan