Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Determine clipboard data type?

I'm using the following code to get the clipboard contents:

obj.GetFromClipboard
txt = obj.GetText(1)

But how do I determine if the clipboard contains data other than plain text? Like what if it contains a screen snapshot in bitmap format or something else?

-Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Determine clipboard data type?


"RG III" wrote in message
I'm using the following code to get the clipboard contents:

obj.GetFromClipboard
txt = obj.GetText(1)

But how do I determine if the clipboard contains data other than plain
text? Like what if it contains a screen snapshot in bitmap format or
something else?


DataObject methods only handle text, if available. No doubt the original
intention last century was eventually for it to return other formats, but
that never happened.

Simplest is to use the Excel object model's 'ClipboardFormats' which returns
an array of available formats, see ClipboardFormats in help. You could also
use the 'IsClipboardFormatAvailable' API to see if a specified format is
available (examples on line), be aware also need to open and close the
clipboard with OpenClipboard and CloseClipboard.

Peter T


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To determine the data type of the selection range Subodh Excel Programming 2 March 30th 10 06:09 PM
Excel ODBC Driver May Determine Wrong Data Type (Q141284) [email protected] Excel Programming 0 April 8th 08 09:17 PM
Determine if clipboard is empty XP Excel Programming 2 December 2nd 07 01:34 AM
Determine data type in a string news.epix.net Excel Programming 5 October 31st 07 01:56 PM
Determine data type for Pivot Field Mike Dudash Excel Programming 0 January 22nd 04 09:20 PM


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"