Thanks for the reply, Mark.

I did a "copy" from Outlook, and then run dump_clipboard.  Here's what comes up:

Dumping all clipboard formats...
Clipboard format 49161
 -> got 4 bytes via HGLOBAL
 -> got 4 bytes via IStream
Clipboard format 49955
 -> got 168 bytes via HGLOBAL
 -> got 168 bytes via IStream
Clipboard format 49778
 -> got 336 bytes via HGLOBAL
 -> got 336 bytes via IStream
Clipboard format 49374
 -> got 668 bytes via HGLOBAL
 -> got 668 bytes via IStream
Clipboard format 49373
Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\win32com\demos\dump_clipboard.py", line 61
, in <module>
    DumpClipboard()
  File "C:\Python25\Lib\site-packages\win32com\demos\dump_clipboard.py", line 32
, in DumpClipboard
    medium = do.GetData(fetc_query)
pywintypes.com_error: (-2147024882, 'Not enough storage is available to complete
 this operation.', None, None)

Now, if I drag a message from Outlook and drop it onto a wxpython application 
and then run dump_clipboard.py.  Here's what I got:

Dumping all clipboard formats...
Clipboard format 49161
 -> got 4 bytes via HGLOBAL
 -> got 4 bytes via IStream
Clipboard format 49655
 -> got 36 bytes via HGLOBAL
 -> got 36 bytes via IStream
Clipboard format 49379
 -> got 269 bytes via HGLOBAL
 -> got 269 bytes via IStream
Clipboard format 49729
 -> got 490 bytes via HGLOBAL
 -> got 490 bytes via IStream
Clipboard format 49730
 -> got 8 bytes via HGLOBAL
 -> got 8 bytes via IStream
Clipboard format CF_UNICODETEXT
 -> got 36 bytes via HGLOBAL
 -> got 36 bytes via IStream
Clipboard format CF_TEXT
 -> got 18 bytes via HGLOBAL
 -> got 18 bytes via IStream
Clipboard format 49731
 -> got 146 bytes via HGLOBAL
 -> got 146 bytes via IStream
Clipboard format 49171
 -> got 312 bytes via HGLOBAL
 -> got 312 bytes via IStream
Clipboard format CF_LOCALE
 -> got 4 bytes via HGLOBAL
 -> got 4 bytes via IStream
Clipboard format CF_OEMTEXT
 -> got 18 bytes via HGLOBAL
 -> got 18 bytes via IStream

Does that give you any hints?

Mark Hammond wrote: 
On 20/10/2010 4:46 PM, kc106_2005-wi...@yahoo.com wrote: 
>
>Unfortunately, the above code doesn't work.  CF_HDROP is not a format 
>>GetClipboardData recognizes, and DragQueryFile returns None.  Anybody know 
>>what 
>
>>the proper way of retrieving the dropped Outlook info? 
>>
I'm not sure what you mean by CF_HDROP not being recognized - it works  for me. 
 
Using Windows Explorer, select a file and "copy" it to the  clipboard.  Then 
run 
the following script: 


import win32clipboard, win32con 
win32clipboard.OpenClipboard() 
try: 
    got = win32clipboard.GetClipboardData(win32con.CF_HDROP) 
    print got 
finally: 
    win32clipboard.CloseClipboard() 

You should get back a tuple listing the filenames on the clipboard.  I'm  not 
sure what outlook does here, but you may also like to copy the  outlook object 
to the clipboard and run the  win32com/demos/dump_clipboard.py script to see 
what can be found. 


HTH, 

Mark 



 --
John Henry

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to