C#: copy Word doc content to new Word doc

Posted on 2006-05-12
Last Modified: 2008-01-09
is it possible to copy the Word content (including layout) from an existing htmldoc or Worddoc into a new Word doc (with C#)
Question by:secuteamers
    LVL 26

    Expert Comment

    if u want to copy all the content then y not just use System.IO to create a copy of the file?


    Author Comment

    i want to copy the content of multiple Word docs into 1 new doc.
    LVL 15

    Accepted Solution

    I don't have the code with me but you need to utilise the Word API, then select all in the document and then copy it to your clipboard.

    Then you can paste from there.

    Look for the code some code that utilises the Word API and you should be on your way
    LVL 26

    Expert Comment

    u have to use interrop .. add reference to "word" COM in ur project .. declare objects to initialise word.application .. and merfe the documents ..


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now