Clipboard

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan T

    Clipboard

    How to I save the contents of clipboad to the variable and reassign the
    content back to the clipboard ?


  • Cor Ligthert [MVP]

    #2
    Re: Clipboard

    Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.


    "Alan T" <alanpltseNOSPA M@yahoo.com.aus chreef in bericht
    news:e4gRdf6BHH A.4908@TK2MSFTN GP03.phx.gbl...
    How to I save the contents of clipboad to the variable and reassign the
    content back to the clipboard ?
    >

    Comment

    • Alan T

      #3
      Re: Clipboard

      Hi,

      I use the following to save the content and restore to the clipboard but
      finally the clipboard is empty:

      private IDataObject _clipboardConte nt;

      private void StoreClipboardC ontent()

      {

      _clipboardConte nt = Clipboard.GetDa taObject();

      }

      private void RestoreClipboar dContent()

      {

      Clipboard.SetDa taObject(_clipb oardContent, true);

      }

      As I called:

      StoreClipboardC ontent();

      rngTarget.Copy( );

      rngInsertBookma rk.Paste();

      RestoreClipboar dContent();



      After application exits, I opened a word document and CTRL-V, there is
      nothing to be pasted.

      "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
      news:%23yB$Fr6B HHA.1224@TK2MSF TNGP04.phx.gbl. ..
      Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.

      >
      "Alan T" <alanpltseNOSPA M@yahoo.com.aus chreef in bericht
      news:e4gRdf6BHH A.4908@TK2MSFTN GP03.phx.gbl...
      >How to I save the contents of clipboad to the variable and reassign the
      >content back to the clipboard ?
      >>
      >
      >

      Comment

      Working...