none
Copy something and paste in active word editor RRS feed

  • Question

  • I am using C#

    I have a button.

    On button's click event i want to add a text in the active word editor. 

    The word editor may be MS Word, Open Office Word, or mac word.

    How can i do this?


    markand

    • Moved by Fred Bao Tuesday, February 25, 2014 5:19 AM office-dev related
    Monday, February 24, 2014 6:06 PM

Answers

  • Hello Markand,

    All these three application provide different programmability support. The current forum is for MS Word. That's why I'd recommend asking such question in the Open Office Word and Word for Mac related forums too.

    Microsoft Word for Windows (its object model) provides the Paste method of the Range class for pasting the data from the clipboard. Also C# (.Net base class libraries) provide the Clipboard class which can be used for extracting the data from clipboard. You may find the following forum threads helpful, they provide samples in C#:

    C# Word Interop, Pasting Clipboard into Paragraph

    Paste text to an active Word window using c#

    Tuesday, February 25, 2014 6:46 AM