Pasting HTML to the clipboard to be used by Windows native apps

I'm having problems creating a DataFlavor that will allow me to write a
string to the clipboard in html format so that a windows native app (e.g.
MS Word) can recognise this format and allow me the option of
pasting as html rather than just plain text.
I've found that if I alter my code to first get the contents off the
clipboard (some html I copy from an Internet Explorer-viewed web page), I
can extract the html DataFlavor from the Transferable object that IE has
placed on the clipboard. If I then use this "stolen" DataFlavor to write my
contents to the clipboard, I find that I can successfully paste as HTML in a
windows native app.
However, since I can't rely on grabbing some html from IE just to get a
suitable DataFlavor each time I need to use my copy function, I have been
attempting to construct my own DataFlavor to match the characteristics of
the IE example flavour.
The problem is that, having set the representation class, MIMEType and human
presentable name to match the IE flavor, when I call DataFlavor.equals() to
compare the two flavours it returns false, and my constructed flavour
subsequently fails to show up as a paste option in any native apps. Having
compared every possible property of both flavours, I've concluded that the
only difference between the two is that the IE flavour has the charset
parameter set as utf-8, whereas my constructed flavour has no charset
parameter specified. I have found no way to manually set the charset. So
calling getMimeType() on each flavour gives:
IEDataFlavor.getMimeType() = text/html; class=java.io.InputStream; charset=utf-8
MyOwnDataFlavor.getMimeType() = text/html; class=java.io.InputStream
Using the Windows Clipboard viewer I have observed that my constructed
DataFlavor does exist on the clipboard, however whereas the IE flavour's
visible name is "HTML Format", mine is "JAVA_DATAFLAVOR: text/html;
class=java.io.InputStream"
and I think this is the reason that native windows apps are failing to
recognise my DataFlavor as a valid option for display.
I'm using jdk 1.3.1
If anyone has ever encountered this problem or can think of a solution I'd
be extremely grateful for your help.
Thanks,
Steve White

I have a similar problem:
IE actually put the "HTML Format"(CF_HMTL) flavor into the clipboard, with some additional info, such as SourceURL as the description.
see
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/clipboard/htmlclipboard.asp
How will this information be available to Java clipboard?
Main question, for HTML data pasted by IE into the clipboard, how to get the source url.
I know some Windows native apps could get that info nicely.
Thanks!

Similar Messages

  • Very slow pasting data from the Clipboard into a Sharepoint 365 list by using the Quick Edit view

    <p>In sharepoint 2010 it was very fast to paste data from the Clipboard by using the Data Sheet view. Why is it so slow in Sharepoint 365 when using the Quick Edit View? is there a workaround?</p><p>also in Sharepoint 365 if you try to
    paste a large number of records (2,000) it will freeze.</p>

    I'm interest about same thing. Clipboard is often only way to migrate lists between sharepoint versions and now it is almost unpossible to use.

  • Hello, I have the usual issue to use AcroExch.PDDoc/AcroExch.App/AcroExch.AVDoc objects in Visual Basic (MS EXCEL). On my company's machine I have Acrobat X and everything works fine, but I have another machine with just "Reader" installed - is there als

    Hello, I have the usual issue to use AcroExch.PDDoc/AcroExch.App/AcroExch.AVDoc objects in Visual Basic (MS EXCEL). On my company's machine I have Acrobat X and everything works fine. I am looking for the cheapest solution to get the stuff running on another machine... is there any way to do that with the Acrobat SDK, or do I need to purchase a full version of Acrobat XI ($$) ?

    The Acrobat SDK is nothing by itself. It is just information on how to automate Acrobat - just as the Office SDK doesn't include Office, but is for people who already have purchased Office but want to automate it.
    These automation things are MARKETING TOOLS FOR ACROBAT. Consider this and the technical limitations make a lot more sense.
    So, yes, you need to buy Acrobat. Standard is cheaper than Pro.

  • I am trying to retrieve my photos from my I phone 4s because the screen is smashed. The pc that I use is windows not an apple computer. Can anyone give me step by step instructions how I can get my photos? Also, I don't have icloud.

    I am trying to retrieve my photos from my I phone 4s because the screen is smashed. The pc that I use is windows not an apple computer. Can anyone give me step by step instructions how I can get my photos? Also, I don't have icloud

    If the iPhone is still working and the photos are in the Camera Roll (i.e., taken on the iPhone) then, when you connect the iPhone to your PC, it should be recognized as a Camera and Windows should start AutoPlay.
    See this http://windows.microsoft.com/en-us/windows/get-pictures-camera-computer#1TC=wind ows-7

  • Can someone tell me the best stylus to use with good note app.

    Can someone tell me the best stylus to use with good note app?

    I use the Jot Script stylus with Good Notes on a daily basis, and I'm realy satisfied. I recently did some videos to show how this works for me, you could check it out, and I hope it'll help you find the perfect stylus and app!
    https://www.youtube.com/user/AurelienChe

  • On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when on calls using internet based / native apps like viber or skype, people can hear me just fine. Voice memos work too and have already tried different SIMs

    On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when I make/receive calls using internet-based / native apps like viber or skype, people can hear me just fine. I have tried recording my voice using voice memos - this works. And have already tried different SIM cards but the problem persists.
    I have taken my phone to an authorized Apple service center, where they restored my phone to factory settings, but still facing the same issue. They service center directed me to Apple Customer Care Hotline, where I have now spent 3+ hours explaining my issue and yet no one can resolve it. The easy answer if to replace the phone - and since it is out of warranty, I am expected to pay for it.
    Additionally, the customer service has been so rude and confrontational that it has completely changed my view of Apple and its customer focus. I am a disappointed and angry customer today - people would be surprised to hear just how rude customer service was including making statements such as "Apple doesnt make infallible products, that's why warranty is needed for our products" and that "every product undergoes a problem at some stage, so do ours!" There goes whatever confidence I had...
    My concern is simple - if no one at Apple and / or its CS hotline is able to address my issue comprhensively and keep telling me that they have never encountered a precedent before, then with what right can they expect me to pay for a replacement?! I am NOT here to fund Apple's research into their product faults and manufacturing.
    And even though a customer is out of warranty, is it too much to expect an Apple product to work well for at least a 'reasonable' period of time. My phone is less than 18 months old and has been facing this issue for the past 2 months - surely the longevity of Apple products is more than 18 months!
    Just a sad sad day for an Apple customer, compounded by unjustifiably rude and aggressive staff. And still no resolution to my problem.

    I am having the same issue - with my last 2 iPhone 4's. My first handset each time I was on a call wether it was up to my ear or on loud speaker, the call would automatically mute even though the mute button wouldn't show up as highlighted. Pressing the mute button on and off during the call doesn't fix it either. I rang Apple and asked what some of their trouble shooting solutions were. I got told that it might be a software issue and to install the latest software update. This failed. I then got told to uninstall the software on the phone and do a complete restore. This also failed. After trying the troubleshooting suggestions, I took the phone into my provider and they sent me out a new phone within a week under warranty claiming it was a hardware issue and probably just a "glitch" with that particular phone. This was not the case....
    After receiving my second iPhone 4, I was hopeful that it would work. For the first couple of days, making/receiving calls was not an issue. Until after about a week, the same problem started again. In one instance I had to hang up and call back 4 times and the call would still automatically mute after about 5 seconds. Also on the second handset, the main camera located on the back of the phone has red and blue lines running through it and can't take a decent picture. So back to the store I go to get another replacement - Again.
    For a phone that is rated highly and as a keen Apple product purchaser, I am a bit disappointed with the experience I have had with the iPhone 4. Let's hope they find a fix sometime soon because this is becoming a bit beyond a joke.....!!

  • Why my code(CS2 VB Script) only pastes what on the clipboard, not everything I select?

    I have created a graph, now I want to copy the entire thing to a new document.  I used the following code.  Even visually you can see it selected everything in the document, but when it pasted to a new document, it only pasted what's left on the clipboard, not everything as I wanted. 
    What's wrong here? Does it have anything to do with grouping?  See code below.
    Please help!  Thanks.
        Dim oCurDoc As Illustrator.Document
        Set oCurDoc = oApp.ActiveDocument
        Dim iPageItemCount As Integer
        iPageItemCount = oCurDoc.PageItems.Count - 1
        Dim vItems() As Variant
        ReDim vItems(iPageItemCount)
        Dim oPageItem As Object
        For Each oPageItem In oCurDoc.PageItems
            Set vItems(iCnt) = oPageItem
            iCnt = iCnt + 1
        Next   
        oCurDoc.Selection = vItems
        Dim oNewDoc As Illustrator.Document
        If oApp.Documents.Count > 0 Then
            If TypeName(oCurDoc.Selection) = "Variant()" Then
                oCurDoc.Copy
                Set oNewDoc = oApp.Documents.Add(aiDocumentRGBColor)
                oNewDoc.Paste
            End If
        End If

    Yes, I tried to group them first by
        Dim oGrp As GroupItem
        For Each oPageItem In oCurDoc.PageItems
            Set oGrp = oCurDoc.GroupItems.Add
            Set oPageItem = oGrp.PageItems.Add
            iCnt = iCnt + 1
            If iCnt > iPageItemCount  Then Exit For
        Next
         oCurDoc.Selection = oGrp
    But the selection is always "empty" - nothing been selected.  Why?
    Thanks.

  • I want to copy an image to the clipboard in firefox using firefox clipboard API

    I Want to copy an image to the clipboard using firefox clipboard API.
    Please let me know he steps

    Thanks for the reply, but I want to copy the IMAGE to the clipboard programmatically in javascript using firefox clipboard API.
    For ex using the following syntax:
    var clip = Components.classes'@mozilla.org/widget/clipboard;1']
    I am able to copy the text, but I don't know the syntax to copy the IMAGE.

  • Reading HTML after the onload Method is used in the website

    Hello,
    I try to read a HTML site with the HttpURLConnection. That works fine.. But I only geht the static html. Is it possible to read the html after the javascript is done... In the site I calc a result with a external method (JS) so I need to calc and than I read the elements....
    Example:
    mySite.jsp?first=1&second=3
    in the Site
    <script>
    function test() {
    document.getElementById("foo").innerHTML = <c:out value="${param.first * param.second\" />;
    window.onload = test;
    </script>
    <div id="foo"></div>
    This is a simple example to show how the site works.... But I have no chance to disclaim the javascript....
    Thanks for help

    The server just generates the Javascript. It doesn't run it at all. That's the job of the client, which in this case is your program. So, you would have to parse the HTML and execute the Javascript that's in the onload method. This will be a non-trivial amount of work.

  • I bought an iPhone 5s in China and the maps app is different.  When I go to the US will I be able to use Apple's native app or will I be stuck with this one?

    So I wanted to ask a question that my googlefoo couldn't help me solve.
    I bought an iphone at a reputable electronics market here in China and it is an AT&T model phone.  I bought it at one of the grey market locations because they were sold out elsewhere.  I contacted a friend at AT&T to make sure it is a legit AT&T model.  The phone is great and everything works perfectly including maps.  But maps are done by Autonavi here in China, not Apple.  I downloaded the Mavericks update on my mac and tried some of the new maps features and they wouldn't work with my phone.  That's okay since I live in China now but I'll be going back to the USA soon and I wonder what will happen.  Will it update the app to Apple's native one or stay with Autonavi.  Autonatvi does not have the flyover features and it is not robust in the USA.
    Who can help me out here?  Has anyone purchased a 5, 5c, or 5s in China and gone elsewhere?  Did the maps app change?
    Thank you
    tl;dr my china iphone has autonavi for maps not apple, when I go to the usa will I get the native app?

    I live in China as well and my iPhone5s is the model A1530 I bougth outside China. I have the same problem as Nikatnight with the iPhone while the iPad Air (wifi only) is working like a charm. It must be definitely something related to the carrier since I was abroad few days ago and everything worked well.
    If you pay attention at the source of your maps, you'll discover they are provided by AutoNavi instead of TomTom and make them appear in chinese with their own border interpretation. Queries are only acceppted in Chinese (p.e. if I type in english "Los Angeles International Airport"  it replies it cannot locate it)
    I suppose everything will be fine when you'll be out of censorship....
    Perhaps iOS  Apple Maps are absolutely useless for expatriate in China.
    Use Google Maps instead
    BTW, I'm surprised how much Apple might prostrate towards hard power Governments.... No matter what, money are always on top!

  • Which Nuget Package for Azure Service Bus can I use for Windows Store apps?

    Hi,
    I want to use the Azure Service Bus Topics. I have an app that needs to subscribe to the Service bus Topic. The Nuget-Package for Azure Service Bus is not applicable for Windows Store Apps (I get an error during install), thats why I used the Windows Azure
    Service Bus managed for Windows Store. Unfortunatelly this API throws a Serialization Exception when I create a subscription. What can I do to use the Service bus in Windows store apps?
    Thats how I try to create the subscription:
    await Microsoft.WindowsAzure.Messaging.Subscription.CreateAsync(TOPIC_NAME, SUBSCRIPTION_NAME, CONNECTION_STRING);

    Yes this is the one I used.
    But creating a subscription with the code above throws the SerializationException mentioned in this question:
    http://social.msdn.microsoft.com/Forums/de-DE/1acb887e-d5f1-4bfb-8eb9-f8ce7390ae7b/microsoftwindowsazuremessagingsubscriptioncreateasync-throws-an?forum=servbus&prof=required.
    Maybe I do something wrong? Do I Need to do something before creating the subscription?
    I haven't found any sample that shows how you can subscribe to a Topic and receive Messages using the restricted Api for winrt :(
    Any suggestions?

  • For uml 295 what should the settings be, for use with windows 7?

    I have a uml 295 mobile broadband device. About 90% of the time even though  the device says it is connected, when I  try to access the  internet I get a message that says "no internet connection".  I have  a windows 7 operating system.  I wonder if the settings on the device are wrong?  I didn't change any defaults or enter any other information under "settings". Do I need to do something else to make this work?

    I don’t get an error message.  The broadband manager says that I’m connected and the timer is running.  But Internet explorer says “you are not connected to a network.” 
    I wouldn’t describe this as “losing” the connection. After I click on “Connect”, the manager says it is connected but IE says I am not connected to a network, and mail program says it can’t contact servers.
    I have 2 dell laptops with very similar factory supplied software (windows 7, McAfee antivirus) and the same thing happens on both computers.  I have a Novatel wireless broadband device that works great on both of these Dell laptop computers. 
    I tried the UML295 on my Dell desktop and it seems to work fine there.  But that’s not where I want to use it.  Maybe the Dell laptops have some software properties that are incompatible with this device.

  • For the last week while using iTunes(Windows 7) i have not been able to get the names of songs from CDDB when importing CDs. Very frustrating! Can anyone help me out?

    CDDB in itunes is not bringing up the name of songs on CDs when importing into itunes. This has been going on for a couple of weeks. Any help?

    I have, a couple different pairs, unfortunately, and still no change. TBH, the headphones don't bug me nearly as bad as the fact that I can't plug my iPod into a radio or speaker with an audio cable and hear my latest purchases. Drives me crazy that I can't listen to my tunes!    

  • Cannot use MAFLogon(iOS native apps) to connect to SMP 3.0 SP05 Server

    Hi experts,
    I have a problem when i try to use MAFLogon to logon/register on my SMP server ( im using iOS native Application). I fill some values, and waiting for login, but it doesnot work.
    This is my config at MAFLogon UI Screen.
    This is my application on SMP Server
    This is my .plist config on MAFLogonManagerNG

    1.
    When i run https://<ip_server>:443 in the Safari browser of iOS simulator, i cannot connect because of credential
    >> you may have to import the certificate, i believe. Have a look at this.http://scn.sap.com/docs/DOC-50247
    2.
    As you say, i'm using Integration GW, when i try to ping the backend without "Internal" check, it works. When i check "Internal" and ping again, it still works.
    >> Ideally, that option should be checked if endpoint URL is from IGW.
    Should i replace https port 443 = 8083 ? Because the backend use https:<ip>:8083/...
    >> 8083 port is admin port and used for accessing admin cockpit and gateway cockpit (plus all odata services listen on same port iff exposed via IGW) . 8083 is nothing to do with registration.
    I suggest you to try with 8080 first. In that case you have to set secured channel off from login screen.
    Regards,
    JK

  • 10.3 Apps crash whenever trying to use the clipboard

    Hello all,
    My girlfriend recently got a B+W G3 350. We spent some time with it and have 10.3.3 up and running quite nicely.
    There is only one small problem: whenever you try and copy or paste text in any application (we've tried Safari, FireFox, TextEdit) the application crashes with an "Unexpectedly Quit" error.
    The only exception to this is AppleWorks 6; the clipboard works without a hitch in that app.
    After having lots of "Unexpectedly Quit" messages with my G4 MDD, I decided I would try memtest on the G3 and make sure there wasn't anything going on there (as had been the problem with my G4).
    I ran it on all RAM, 5 passes. Passed.
    Any help would be greatly appreciated. She can still work in AppleWorks for her schoolwork, so it's really more of a nuisance than anything, but I'd like to have it resolved. If possible, I'd like to not update it to 10.3.9, as I did have it running for a time on a similar machine and it was much slower than 10.3.3.
    I have also Safe booted; same problem there. And I tried rm'ing /Library/Preferences/com.apple.finder.plist, to no avail.
    Once again, thanks for any help.
    Chris Graham
    B+W G3 350   Mac OS X (10.4.9)   256MB RAM, 12GB HDD, Rage 128

    You're Again Welcome Chris!
    "...and the disks that came with the laptop."
    AHA! That's one problem! You must use the Full Retail Version, of the Panther Install CDs.
    Additional info in these links.
    Using OS X Install CDs/DVDs On Multiple Macs
    What's A Computer Specific Mac OS X Release
    Software Update, Upgrade: What's The Difference?
    "...I did not install the SCSI card firmware update,..."
    That's another problem. The Firmware Update must be installed.
    You must start the computer from a Mac OS 8 or Mac OS 9 System Folder on the computer's hard disk, not from a CD, in order to install it.
    And that creates yet another problem, as you do not have the original system discs.
    Where did you acquire the Mac? Is there any way of contacting the previous owner to request them?
    Panther, is no longer available directly from the Apple Online Store, as Tiger 10.4.x is the most up to date OS.
    If you know what to look for, a Full Retail Version, of the Panther Install CDs, can be purchased rather inexpensively, at some online Apple retailers, Amazon, eBay, AppleRescue, FastMac, etc.
    Be sure not to purchase grey, upgrade or machine specific CDs or DVDs.
    Panther is only on CDs, not DVDs.
    Unless purchased from AppleRescue, the discs should look exactly like the images in the above links, and not say Upgrade on them.
    Once Panther 10.3.x is installed, you can use the 10.3.9 Combo Update, to upgrade to the final version.
    Panther System Requirements
    Additional Panther System Requirements
    Shop Carefully, Examine All Documentation, And Good Luck!
    ali b

Maybe you are looking for

  • Can't get devilspie to work properly

    I'm trying to get a terminal window to be below my other windows, always on the current desktop, unclosable/unminimizable, and centered. I've managed to do everything but the last two. Devilspie does not center the window (it will if I kill it and re

  • InfoView needs login information when dynamic parameters are included

    Hi, we've got a Crystal Reports Server 2008 and everything worked fine in the past, but then we had to reinstall the server and now we've got the following problem: Although we saved the Login information of the report on the server, InfoView asks th

  • Need Advice: How to do clustering with PointBase DBMS

    Hi, I am doing an application that requires me to update several pointbase databases with same schema(running on separate machines) and perform transactions using them. I would be greatly appreciated if someone can tell me what are the available code

  • Prepared Statement nested calls (Oracle)

    I have a prepared statement like select type , id from ms_page_position where page_id = (select id from ms_url where url = ?) and column_id = (select id from ms_column where name = ?) and preview = ? order by position asc. If i place in pstmt.setStri

  • MDX output query is too large to display

    Mdx is truncating our report. What should we do to see the entire report?<BR>We get the following error message at the end of the report: Error 1241172 "MDX output query is too large to display"<BR>Thanks in advance<BR>Sibel