A Alan T Nov 14, 2006 #1 How to I save the contents of clipboad to the variable and reassign the content back to the clipboard ?
How to I save the contents of clipboad to the variable and reassign the content back to the clipboard ?
C Cor Ligthert [MVP] Nov 14, 2006 #2 http://msdn2.microsoft.com/en-us/library/system.windows.forms.clipboard.aspx
A Alan T Nov 15, 2006 #3 Hi, I use the following to save the content and restore to the clipboard but finally the clipboard is empty: private IDataObject _clipboardContent; private void StoreClipboardContent() { _clipboardContent = Clipboard.GetDataObject(); } private void RestoreClipboardContent() { Clipboard.SetDataObject(_clipboardContent, true); } As I called: StoreClipboardContent(); rngTarget.Copy(); rngInsertBookmark.Paste(); RestoreClipboardContent(); After application exits, I opened a word document and CTRL-V, there is nothing to be pasted.
Hi, I use the following to save the content and restore to the clipboard but finally the clipboard is empty: private IDataObject _clipboardContent; private void StoreClipboardContent() { _clipboardContent = Clipboard.GetDataObject(); } private void RestoreClipboardContent() { Clipboard.SetDataObject(_clipboardContent, true); } As I called: StoreClipboardContent(); rngTarget.Copy(); rngInsertBookmark.Paste(); RestoreClipboardContent(); After application exits, I opened a word document and CTRL-V, there is nothing to be pasted.