Results 1 to 4 of 4

Thread: hard one

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    how do i know if selected text, i.e. rtf.seltext, contains two or more font types such as two different font names or two different font size?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    I could be wrong on this but I thought that the rtf just takes the last font selection and that is the selection for the whole box.
    ie> everything is bold and NewRoman 12

    Code:
    Private Sub Form_Load()
        With RichTextBox1
            .Text = "line one" & vbCrLf
            .Font = "courier"
            .Font.Size = "14"
            .Text = .Text & "line two" & vbCrLf
            .Font = "New Roman"
            .Font.Size = 12
            .Font.Bold = True
            .Text = .Text & "line three"
        End With
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest
    This will detect the text's font in the RichTextBox:

    Code:
    Private Sub Command1_Click()
    If RichTextBox1.SelText <> "" Then
    Msgbox RichTextBox.SelFontName
    End If
    End Sub
    If you want to extract the contents of the RichTextBox:

    Code:
    Private Sub Command1_Click()
    If RichTextBox1.SelText <> "" Then
    Msgbox RichTextBox.SelRTF
    End If
    End Sub

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    I wasn't really asking for what you guys had in mind... but it's ok, I figured how to do it by errorhandling.. thans anywayz

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