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

Free Support Forum - aspose.com


Dear Sir
I want to copy a section between two document.I found it in your help .

Dim m_Document As Document = New Document("D:\Old.htm")
Dim m_Document1 As Document = New Document("D:\New.doc")
Dim sourceSection As Section = m_Document.Sections(0)
Dim NewSection As Section = CType(m_Document1.ImportNode(sourceSection, True), Section)

It works very well but I have a problem. My text is right to left and the result is a reverse string.I know your component have “Bidi” property for this purpose but I don’t know how to set it.
Please tell me how could I do it.
Mehdi Mokhtari

Thanks for your request. Maybe you should use “ImportFormatMode.KeepSourceFormatting” See the following code snippet.

Dim NewSection As Section = CType(m_Document1.ImportNode(sourceSection, True, ImportFormatMode.KeepSourceFormatting), Section)

Hope this helps. Also please attach your documents for testing.
Best regards.

Hi alexey
Thanks for your quick reply.
I used it but it didn’t make any difference in result.
I attach my documents for testing.
I hope you could help me.
Mwhdi Mokhtari

Thanks you for additional information. I think that you can try setting Bidi property for each style in source document. For example see the following code snippet.

'Open source document
Dim srcDoc As Document = New Document("New.htm")
'Set Bidi property for each style in source document
Dim srcStyle As Style
For Each srcStyle In srcDoc.Styles
If (Not srcStyle.Font Is Nothing) Then
srcStyle.Font.Bidi = True
End If
'Open destination document
Dim dstDoc As Document = New Document("0012.doc")
'Get source section
Dim srcSection As Section = srcDoc.Sections(0)
'Import section
Dim dstSection As Section = CType(dstDoc.ImportNode(srcSection, True, ImportFormatMode.KeepSourceFormatting), Section)
'Append content of source section
'Save output document

Hope this helps.
Best regards.