Results 1 to 4 of 4

Thread: HELP ME SOOOOOOOOON!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    10

    Angry


    i want to copy the text of richtextbox to ms word
    for this i used the clipboard.

    i used the code to copy to the clipboard
    Clipboard.SetText RichTextBox8.TextRTF, vbCFRTF
    it works.


    but when i used the code to copy to the MS word

    r.Range.InsertAfter Clipboard.GetText(vbcfrtf)

    {where r as document}

    then what i see on the MSword is.


    {\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss MS Sans Serif;}}
    {\colortbl\red0\green0\blue0;}
    \deflang1033\pard\plain\f2\fs17 Ric\plain\f2\fs17\b hTextBox8
    \par }


    i have the text "richtextbox8" in the text box.
    but when i use the "ctrl+v" to paste the text in the word then it pasted formatted text( that is what i want)

    please give me the coding to insert the formatted text to the ms word.


    waiting 4 reply
    it would be a great help!!!!!!!!!!!!!!!!!!!!!!!!!!!

    sk

  2. #2
    New Member
    Join Date
    Jul 2000
    Location
    Belguim
    Posts
    15

    Wink Hi,

    Hi,

    It is realy easy change the row:

    Clipboard.SetText RichTextBox8.TextRTF, vbCFRTF
    To:
    Clipboard.SetText RichTextBox8.Text, vbCFTEXT

    You past the rtf script into the clipboard, not the text!
    And if you want to have the RTF settings, then use not settext
    but, setdata!

    Best Regards
    The GabitaSoft Crew

    http://www.Gabita.com
    http://www.VisualBasicTec.com

    Or mail to:
    [email protected]

    [Edited by GabitaSoftVB on 08-21-2000 at 02:07 PM]

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    10

    Red face deeply in trouble


    THANX 4 REPLY!!!!!!!!!!!!!!!!!!!!!

    u r quite right

    when i used "vbcftext" instead of " vbcfrtf", then it copies the text the clipboard

    & then i used the code to insert the MS word

    dim r as document
    dim s as range
    set s=r.paragraph(4).range
    r.range.insertafter clipboard.gettext,vbcftext


    this code pastes the text without formatting

    what i want is:
    i have sometext in textbox(some formatted text)& i want to insert it(formatted text) in MSword.


    throu' the above coding it pastes text without any format.


    help me soooooon!!!!!!!!!!!!!!!!!!!!!!!


    sk

  4. #4
    New Member
    Join Date
    Jul 2000
    Location
    Belguim
    Posts
    15

    Thumbs up GabitaSoft

    Hi,

    You can better ask this question in General VB questions!

    GabitaSoft Crew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width