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

Free Support Forum - aspose.com

Inserting text and images at a bookmark

I have data in a richtextbox that have text, but may also contain images at times. I need to take everything in the richtextbox and place it at a bookmark. I can save everything in it to a word doc with “richtextboxcontrol.SaveFile(exhibitFile, RichTextBoxStreamType.RichText);” Is there a way to take the entire file as a stream and place it at a bookmark in another file?

Hi Robert,

Thanks for your inquiry. Yes, this is possible; you need to extract content from rich text box, move cursor to the bookmark and place the copied content inside that bookmark. Please refer to the following articles:

https://docs.aspose.com/words/net/how-to-extract-selected-content-between-nodes-in-a-document/
https://docs.aspose.com/words/net/navigation-with-cursor/
https://docs.aspose.com/words/net/working-with-bookmarks/

You can also insert document into another document using Aspose.Words:
https://docs.aspose.com/words/java/insert-and-append-documents/

You may attach your input Word document and expected document here for our reference? We will investigate your scenario further and provide you code to achieve this.

Best regards,

Thank you for the reply. Inserting the content of the text box did not work, which is why I asked about saving the content to a file and inserting that document into the main document. The reason it doesn’t work is because the only method if have found to extract the data is x.Text; which only gets text, not images. Saving to a word doc with the Save method preserves images. So, I think I will have to use that approach.

InsertDocument(exhibitBookmark.BookmarkStart.ParentNode, tmpDoc); Is not found…

I have the following using statements:

using Aspose.Words;

using Aspose.Words.Rendering;

Hi Robert,

Please attach your input Word document and expected document here for our reference. You can create expected document using MS Word. We will investigate your scenario further and provide you code to achieve this.

Best regards,

I have the code to do it according to your website. However, when using the call InsertDocument, I get this error: “Error 2 The name ‘InsertDocument’ does not exist in the current context C:\Data\dev\Visual Studio Projects\Exam 2008\mainWin.cs 18630 41 Examination App”

If you could just tell me what using statement to use where it can be found. I am using version 2.0.50727 of Aspose.Words

I need to insert everything in TEST tmp A.rtf into TEST Exhibit A.rtf at a bookmark called FieldNotes

Hi Robert,

Thanks for your inquiry. Including following namespace should work fine:

using Aspose.Words;

The method has a static keyword at the beginning, you may try removing it and see if it helps. Also, could you please try creating a new sample application from scratch and see if the problem still remains.

Best regards,

I already have using Aspose.Words; or nothing else would be working. I told you what version I am running. Does that have anything to do with it?

Hi Robert,

Thanks for your inquiry. Please use Aspose.Words 14.7.0.

https://downloads.aspose.com/words/net

I have also attached a sample console application which works fine on my end. Could you please attach your simplified version of solution project? We will investigate the issue on our end and provide you more information.

Best regards,

I downloaded total .net and cannot get it to install. I have attached a screen shot.

Hi Robert,

Thanks for your inquiry. Our web development team will investigate this problem and get back to you soon. Sorry for your inconvenience.

In the mean time you may try downloading Aspose.Words for .NET 14.7.0 separately from the following link. I hope, this helps:
https://downloads.aspose.com/words/net

Best regards,

Hi,

I hope you are well.

Can you please check the following and try again.

  • Please make sure that you are running the installer from your local disk and not from a network location.
  • Please run the installer as ‘Administrator’.

If you are still experiencing any issues, please let us know which version of windows you are using so that we can test the installer accordingly.

I am running the installer from my laptop and I have administrator privilages. I am running under Windows XP… It appears to be having trouble removing the old version. When I hit cancel, I get “The older version of Aspose.Totla for .NET canot be removed. Contact your technical support group.”

I downloaded Aspose.Words before you suggested it, and it does the same thing.

Hi,

We are sorry for the inconvenience. We have tested the current installer and it is working fine on Windows XP as well. Can you please try the following to first uninstall the old version from your machine.

Ok… This is getting frustrating. I was finally able to upgrade to v2.050727 after paying $1500 to renew. I still have the same exact problem. I have attached some sample code. As you can see, I have “using Aspose.Words”… In my method “saveToWord” I am saving everything in the rich text box to “tmp.rtf” and then attempting to insert the contents of that at a bookmark called “fieldNotes”

In my .net environment, InsertDocument is underlined in red. If you hover over it, it says, “The name ‘InsertDocument’ does not exist in the current context”…

This call is simply not in Words dll.

Hi,

Thanks for your inquiry. It would be great if you please create a standalone runnable simple application (for example a Console Application project) that helps us reproduce the same problem on our end and attach it here for testing. As soon as you get this simple application ready, we’ll start further investigation into your issue and provide you more information. Thanks for your cooperation.

Best regards,

The attached project is runnable only if you comment out the line “InsertDocument”

Hi,

Thanks for the additional information. Please note that the “InsertDocument” method is not a built-in method of Aspose.Words’ assembly. It is a helper method which you can get from the following link:

https://docs.aspose.com/words/java/insert-and-append-documents/

Best regards,