Copy/Paste of RTF text from Java to Word

Hiya
I am trying to transfer info from Java to MS-Word via the Clipboard, I have had a look and a play with the code given in the tutorial at
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
But even thought it is implied that the copy and paste of the RTF text will paste in styled text, it does not. Just simple text arrives.
Any hints, links, examples or acts of god to help a desperate programmer would be appreciated.
thanks and cya
Storm

Sorry it took me this long (over a year!) to get back to you all, but thanks for the info.
In that time due to ugrades the above URL has changed to
http://java.sun.com/j2se/1.4.2/docs/guide/swing/1.4/dnd.html
and will prob oon change again to version 1.5
Thanks again (deposited Duke$)
Efran

Similar Messages

  • How do I copy and paste text from a converted Word document?

    I just converted a pdf file into word.  I want to copy and paste the informatiuon into another document.  How do I do that?

    Hi Sara.  Tanks for responding.  If I cannot figure this out (I  was up
    until 2am last night), I want to cancel my subscription.
    Here are two files you can check on/help me with.  When I try again,  it
    comes up 'an error has occurred when trying to access the service.'
    Please advise.
    Pat Tomassi
    In a message dated 11/1/2014 12:55:23 A.M. Eastern Daylight Time, 
    [email protected] writes:
    How  do I copy and paste text from a converted Word document?
    created by Sara.Forsberg (https://forums.adobe.com/people/Sara.Forsberg) 
    in Adobe Acrobat.com Services - View the full  discussion
    (https://forums.adobe.com/message/6888908#6888908)

  • How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    Or choose Window > Arrange > Tile
    And, you of course can copy/paste without tiling.

  • How can I copy a paragraph of text from a Kindle book on the iPad?

    I just purchased a book to read on the Kindle app on my iPad.
    I would like to copy a paragraph of text to email to someone or to possibly quote in a blog post.
    How can I copy a paragraph of text from a Kindle book on the iPad?

    I'm very late to the conversation but thought I'd chime in since I've just been dealing with this myself. One way to copy from Kindle books is to make sure that you have your settings to backup highlights etc. online, then highlight the text in the Kindle app, go to your Kindle webpage (https://kindle.amazon.com/your_highlights) and copy the text from there.
    Remember, to be able to do this you have to set the app to backup highlights etc. I think this is set individually for each book. On my iPad the default is to backup.

  • How to copy paste a table structure from word document into Text Field [field format Rich Text]

    In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
    Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
    Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
    Is there anyway to copy paste table structure as it is from word document into Text Field?

    Hi,
    I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
    Niall

  • Copy and paste user formatted text from Filemaker to...

    I need to copy user formatted text from Filemaker to any text program that will maintain the formatting. Subsequently it will be going to an rtf. I have limited knowledge of Filemaker and Applescript (and I am not sure that Applescript is the right approach). This is a repetitive process with frequently changing data and users who use italics on a word one day and then decide to bold it the next day. I have created an Applescript that copies and pastes the text into either TextEdit or Microsoft Word but the user formatting is always lost. It is frustrating that I can use Apple-C and Apple-V and the formatting is maintained. But I need to automate this process. Here is a copy of my humble attempt at an Applescript to do the job. it copies the text but not the formatting.
    tell application "FileMaker Developer"
    open "MacintoshHD:Users:stuart:Desktop:Practice.fp7"
    set the clipboard to record 2 of table 1 of database 1 as styled text
    end tell
    tell application "TextEdit"
    activate
    set the text of document 1 to (get the clipboard as text) as string
    end tell
    tell application "Microsoft Word"
    activate
    set myRange to create range active document start 0 end 0
    insert text (get the clipboard) at myRange
    end tell

    I'm not familiar with 'styled text'- which does not mean much other than it's on a very long list of things I don't know. But I do know you can cut several steps out here:
    If your script works so far then you can clean it up:
    tell application "FileMaker Developer"
    open "MacintoshHD:Users:stuart:Desktop:Practice.fp7"
    set mytext to record 2 of table 1 of database 1 as styled text
    end tell
    tell application "Microsoft Word"
    activate
    set myRange to create range active document start 0 end 0
    insert text (mytext) at myRange
    end tell
    Also try:
    set mytext to contents of record 2 of table 1 of database 1 as styled text
    Reese

  • Copy/Paste more than 64K from Excel to Oracle Forms

    We need to copy from Excel more than 64K of data into Oracle Forms 10g. After the copy/paste action. The data will be split and saved in the database. The data contains 6000 fields of each 14 characters.
    What we tried: Create a Long field in forms (maximum size 64K) and process the data which is in this field. But by using PLSQL the maximum size is only 32K. So currently we can only copy and process 32K at a time.
    Is there a way to process over 64K from an excelsheet via Oracle Forms 10g R2?
    Can it be done via Java and how?
    Is it possible to read the clipboard in parts of 30K blocks and paste it in the Long field block with multirecords?
    Restrictions:
    We are not allowed to do file upload and process it on the server side.
    Thanks for your help!

    Hello,
    In the form, you can use Text Items that have datatype as long, so you can strore 64K.
    I do not understand the problem with the PL/SQL, because you can pass 32Ko chunks as many as needed.
    <p>Also, see this article</p>
    Francois

  • Issue Using C# to Get RTF Text From Clipboard to Outlook With Formatting and Without Encoding Tags

    I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox.  A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
    and pasted into an Outlook Email.  When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it. 
    I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly.  This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
    formatting into the mail body.
    I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property.  In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
    work, I feel that I must be missing something really simple while trying to work with RTF.
    I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item.  This is bringing in all the RTF encoding tags.  I have tried to paste this directly into the RTFBody of the mail item,
    yet an execption gets thrown when executed.  Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it.  Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
    it will render properly.
    This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception.  Any help in the matter would be greatly
    appreciated.  I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
    Thanks for the help.
    Some pertinent information:
    Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
    Because of this Systems.Windows.Forms is not in use
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Pasting data into body of email
    myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
    myNewMailIoI.Display(); //Allow for window to be minimized
    myNewMailIoI.Display(true);

    Ok, I found the solution.  Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
    byte stream.  Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes. 
    This is where I failed to understand the previous answers.  I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
    misunderstanding) and that I needed to somehow take this byte array and do something with it.  My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
    after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray). 
    This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property.  Included below is the final code such that I hope that it helps some other
    person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
    using System.Text;
    using Outlook = Microsoft.Office.Interop.Outlook;
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    //Add Subject
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    //Set Body Format to RTF
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
    string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
    byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
    //Inserting RTF bytes into RTFBody property
    myNewMailIoI.RTFBody = myNewRtfBytes;
    myNewMailIoI.Display(); //Displays the newlycreated email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>";

  • Copying text from InDesign to Word: formatting problems

    Hi all,
    I have copied a large amount of text from an InDesign CS4 document into Word. I am now having formatting problems. The main problem is that where long words run over two lines, they are not appearing as hyphenated, and I am not able to stop them running over two lines. Inserting the cursor at the start of the second part of such a word and deleting simply deletes the preceding letter on the line above, as if there were no line break.
    Any help much appreciated.
    Jon Cope

    Instead of Copy/Paste, try selecting the text and exporting to .rtf (or if you have an active cursor, but no selection, theentire story will be exported). Open the .rtf in Word.

  • I can't past in any text from Photoshop to Premiere, RTL or LTR Latin, Hebrew or Arabic text to Premiere Pro cc 2014. It works only between Photoshop 2014 - AE 2014.

    Any one suffering from the same issue?
    I use to write text RTL(right to left) written languages like Arabic and Hebrew in Photoshop, where after copy and paste the text in Premiere to get the job done. With the latest version of Adobe cc 2014 I can't copy and past any text in to Premiere from Photoshop any more, not even text written in latin. Any one has the same problem or work around this issue possibly. It still works fine to copy/paste arabic text written on Photoshop in to After Effects, but Premiere pro 2014 when you paste any text.
    I'm sure this forum works as feedback for Adobe in general and my question is:
    - Does adobe have any intention in the future to implement RTL text writing in Adobe CC or not? Could any one please answer this question from ADOBE?
    As media consultant I can only recommend for my clients using RTL to use Apple FCP X which has built in RTL support and a new way of editing and greater workflow.

    Hi Vince,
    vince_email wrote:
    ...The only things that changed were an update to Yosemite, I started using Time Machine to make regular backups...
    Please check this blog post. Updating from Time Machine can cause this issue: Premiere Pro CC, CC 2014, or 2014.1 freezing on startup or crashing while working (Mac OS X 10.9, and later).
    Thanks,
    Kevin

  • How to copy/paste as unformatted text in Acrobat 9 Pro text field?

    Hi all,
    I'm having difficulty copying/pasting text from another source as unformatted text in an interactive PDF text field in Acrobat 9 Pro. I have specified the font size, colour and typeface for the text field. However, when I copy and paste text, the text retains its formatting. Strangely enough, this isn't an issue when I type out the text.
    I'm really not keen on typing out all the text for all the text fields because:
    there's alot of it
    waste of my time
    potentially introducing typos
    Any ideas?
    Cheers,
    Trish

    Thanks for your suggestion! That actually did work pretty well.
    I had set up all the fields as non-rich text, cut and pasted the text into the fields, and then change the fields back to rich text to format them (ie superscript, subscript etc).
    Unfortunately, now I'm faced with another problem.
    I won't be able to add more "unformatted" text later on easily. It appears that to do so, I would have to change the fields to non-rich text which wipes out all the formatting I've already applied.
    Any suggestions?
    Cheers,
    Trish

  • Copy & Paste images to forms from the clipboard

    hello,
    Java Plug-in 1.6.0_33
    Using JRE version 1.6.0_33-b05 Java HotSpot(TM) Client VM
    Forms Applet version is 11.1.2.0
    Windows 7 64bitForms has successfully done the drag&drop,save image file images to javabeans then save & retrieve it from database.
    Laf project has an example of table-block copy/paste from/to the clipboard feature. You can populate a table-block with the content of the clipboard (Excel, Word,...) and also send to the clipboard with the content of a table-block.
    But a how about the copy & paste images to forms?
    It is posible?Any one tried this one?
    Charles
    Edited by: ck on Aug 12, 2012 3:09 AM

    bump...

  • Copying Hyperlinked Text from PDF to Word (or elsewhere)

    Hello-
    I am at my wit's end, so I hope someone can help... I have a PDF with text that hyperlinks to a web page. It works great within Acrobat Pro, but if I try to copy and paste that text/hyperlink into an email, or word file, it loses the underlying hyperlink and only retains the text.
    Example: The text would say "Click here to hear about Company X and Solution Y" and all of this text is hyperlinked to "www.google.com/companyx" or whatever. When I copy and paste that from the PDF into another application, I am left with the "click here" text, but not the underlying web page.
    Here is the tricky part. I have found that if I select additional text that is not hyperlinked in addition to the hyperlinked text, and then right-click over the non-linked text, I get an option to "copy with formatting". Now I am able to copy/paste as one would expect. The problem is that this is not intuitive at all.
    Can someone please let me know if this is a problem with PDF's, or if I can change settings when I Export out of InDesign? Or is there some other workaround?
    Thank you SO much in advance!
    Dash

    Here is a visual example of what I am referring to, showing the right-click location and the different options that appear. (The blue selection box is from me selecting and dragging around the question from a non-text area)

  • Automatically copy only the unicode-Text from a Word-Document into FM8

    In my daily work I often have the problem to copy and paste text from a  Word-Document or other documents into my FrameMaker documents.
    The common way is to copy it in Word and "Special Paste" it in FrameMaker 8 as unicode. But this is not as confortable as to shortly hit Ctrl-v on the keyboard.
    I would like to have a new menuitem to special paste only the unicode text from the clipbopard. Is there a way to make such a makro and to put it in the menubar with a Key-Trigger?
    I read something like that in http://www.rzg.mpg.de/from_external/Frame6_Handbuch/Setting_up_FrameMaker.pdf (german), but I actually don't know what to chage for my case.

    Rather than create a new menu item (possible, I gather, but fiddly) I would recommendchanging the default “paste” behaviour.
    In the MAKER.INI file there is a line beginning
    ClipboardFormatsPriorities=
    Change this to put UNICODE TEXT as the first item.
    Ctrl-v will then paste Unicode text by default. You can still access the other options, should you need to, by using Paste Special.

  • Copy paste in the application(from file to database)

    Hi!
    Is it possible to provide a 'copy-paste' functionality in end-user app? I know there is such feature in SQL Workshop but I would like to prepare an application which enables users to copy data from fxls/csv file and the paste it into the application. The data should be saved then in the relevant table in database.
    Regards,
    Tom

    Are you talking about importing data into an existing table where the column data type
    needs to match the column data type in your table? Preferably a comma or semicolon
    separated or tab delimited data.
    If this is so, then there is a simple way to acomplish this using external tables as an
    interface. There you need access to your underlying file system. You could do this in
    the following way:
    1. Create a text area and paste some data in it,
    2. Copy that data into a BFILE on your file system,
    3. Create an external table which will read the created file
    4. Query your external table, validate the data and transfer it into your target table.
    This is, of course a simple way - you know the structure of your data in advance.
    You could also do it the way ApEx does it - providing an interface for more then one
    case and letting user create their own tables, load from file, load from xml file, etc.
    However, this would require much more time to make it working.
    Unfortunatelly, there is no access to file system on htmldb.oracle.com for me to
    show you how this could be done. I have a description on how to handle this problem
    here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:94
    This may help you to start with.
    Denes Kubicek

Maybe you are looking for