New User Advice

I am a brand-new user, so forgive absurd questions. I appreciate all the documentation available. But it would really help me to get some feedback on best approaches for my specific tasks. My workflow is pretty clear:

(1) On the web server, in .NET 4, I need to load a Word document template (.dot, .dotx) stored in the file system and paste in RTF loaded from the database. The template can certainly become a document (.doc, .docx) if that is preferable.

(2) I need to turn that into Word or PDF, and send it back to the web client to be automatically opened in Word.

(3) On the web server, I need to take that Word or PDF, and send it as an attachment in email.

Any suggested best approaches and/or pointers to code samples for those specific tasks would be very much appreciated.

Hi Velma,
Thank you for your interest in Aspose.Words.

  1. Using Aspose.Words, you can easily insert or append one document to another. Please follow the link to learn how to insert a document at specific location in your template:
    https://docs.aspose.com/words/java/insert-and-append-documents/
    If you need simply append your RTF document at the end of the main document. You can easily achieve this using Document.AppendDocument method:
    https://docs.aspose.com/words/net/insert-and-append-documents/

  2. You can save the document in any format supported by Aspose.Words. You can find a list of supported formats here:
    https://docs.aspose.com/words/net/supported-document-formats/
    Also, you can send the document directly to the client browser:
    https://reference.aspose.com/words/net/aspose.words/document/save/

  3. You can use Aspose.Network to create and send e-mails. Here you can learn how to attach a file to e-mail using Aspose.Network:
    https://docs.aspose.com/email/net/working-with-attachments-and-embedded-objects/

Please let us know if you need more assistance, we are always glad to help you.
Best regards,

Alexey, thank you very much for the tips.
For inserting one document into another, can you suggest a simple method to mark the insertion point, and find that insertion point?
In some cases the template has a partial sidebar (it’s a letterhead), so the text needs to begin before the end of the existing text, but indented, running alongside the left margin letterhead text. I never actually considered how Word does that, but no doubt you have. Can this be accomplished?
I will look further into the samples meantime.

Looks like this can work for me with AppendDocument, if I set the left margin of what is being inserted–it can handle the left sidebar. Thanks.

Hi Velma,
Thanks for your inquiry.
It’s great you found what you are looking for. Regarding your template, if you are unable to get things to work, please feel free to attach it here and we will assist you.
Thanks,