Do I have to call ::OpenClipboard(NULL) and ::CloseClipboard() during copy/paste?

Discussion in 'Word Programming' started by JD, Sep 14, 2012.

  1. JD

    JD Guest

    Hi,

    Do I have to call ::OpenClipboard(NULL) and ::CloseClipboard() when I call CComPtr<Word::Selection>'s Copy and Paste? I suppose that MS should do that for us internally? If not, is the following sequence correct? Your help is much appreciated.

    ::OpenClipboard(NULL);
    ::EmptyClipboard();
    sel->Copy(); // sel is a CComPtr<Word::Selection>
    ::CloseClipboard();

    ..................

    ::OpenClipboard(NULL);
    sel->Paste();
    ::CloseClipboard();

    JD
     
    JD, Sep 14, 2012
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kph
    Replies:
    0
    Views:
    119
  2. prasanta

    Copy and paste events

    prasanta, Aug 13, 2005, in forum: Word Programming
    Replies:
    0
    Views:
    112
    prasanta
    Aug 13, 2005
  3. delphis96 via OfficeKB.com

    Copy Paste from IE to Word(2003), re-style text, maintain formatting

    delphis96 via OfficeKB.com, Oct 12, 2006, in forum: Word Programming
    Replies:
    4
    Views:
    223
    delphis96 via OfficeKB.com
    Oct 19, 2006
  4. braz

    Copy-paste office documents via clipboard

    braz, Mar 22, 2007, in forum: Word Programming
    Replies:
    1
    Views:
    256
    JensB
    Mar 30, 2007
  5. Supriya

    How to copy row and paste

    Supriya, May 22, 2007, in forum: Word Programming
    Replies:
    2
    Views:
    113
    digbydog
    May 30, 2007
  6. apondu
    Replies:
    0
    Views:
    210
    apondu
    Jul 19, 2007
  7. John
    Replies:
    5
    Views:
    208
    Doug Robbins - Word MVP
    Mar 26, 2010
  8. jic

    Find Result Copy And Paste

    jic, Jan 27, 2012, in forum: Word Programming
    Replies:
    0
    Views:
    297
Loading...