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

Free Support Forum - aspose.com

Replace bookmark with document

Hi,

I have a bug with this code (attach in mail). I have a bookmark, before the bookmark there is a character " and after the bookmark there is a character " (for example: "[bk1]"). The output is not ok because the result is:

"" (Document content)

And the good output should be:

" (Document content) "

I attach de document with the bookmarks and source code (in previous post you give this code) because I don't find the bug in this code.

Thanks for all.

Best regards,

Hi

Thanks for your request. Please try using the method provided here to insert one document into another at bookmark:

http://www.aspose.com/community/forums/288401/problem-to-insert-document-into-other-document/showthread.aspx#288401

Hope this helps.

Best regards,

Hi,

thanks for this code but I have the same problem.

The output is:

"" (Content document)

And should be:

" (Content document) "

I think that the problem is when I delete bookmark then content document always put after double ".

Best regards,

Hi

Thanks for your request. Here is code I used for testing:

' Open template ans source docuemtn that we need to insert into the bookmark.

Dim doc As New Document("C:\Temp\1.docx")

Dim srcDoc As New Document("C:\Temp\src.doc")

' Insert source document into a bookmark.

Dim bkName As String = "DOC__OTRDOC__DOC_C_1"

' Remove old content of the bookamrk first.

doc.Range.Bookmarks(bkName).Text = ""

InsertDocumentAtBookmark(bkName, doc, srcDoc)

' Remove bookmark.

doc.Range.Bookmarks(bkName).Remove()

' Save the result

doc.Save("C:\Temp\out.docx")

As I can see content of the source document is properly inserted. Hope this helps.

Best regards,

Hi,

thanks for this code but the output is wrong too.

In this case the output is...

(Content document) ""

Should be...

" (Content document) "

Best regards,

Hi

Thank you for additional information. I double check on my side and output is correct, i.e. the source document is inserted just between quotes. Could you please attach your template and document you would like to insert? I will check again on my side and provide you more information. Also, you can create a simple application that will allow me to reproduce the problem.

Best regards,

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


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