Re: Lebans RTF2 Control Default Font Microsoft Access 2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: jpkemp (jpkemp_at_kempscaseworks.com)
Date: 05/22/04


Date: Sat, 22 May 2004 11:18:50 -0400

Stephen,
I'm committed to using your RTF2 control and not moving to an HTML
solution. I've looked at the code that is supposed to select the default
font of the box, and have tried to modify the text currently in the box,
to no avail. It may be that I have to select text first or have placed
things in the wrong sequence.
 
This is the code behind my button that corrects the non RTF code with RTF
tags. My problem is that I can't manage to get it to do anything other
than the system font, which when brought up in Word shows up as long thin
lines. If the lines are highlighted and the font changed, there isn't a
problem.

Thanks for your help with this.

The code selects memo field contents (summary) that are missing RTF
coding. It blots out the RTF label or that shows up in the first record.
It then puts in the required tabs and paragraph markers and drops it into
the RTF box. This puts the code in and then it's stored back in the memo
field. It loops through the recordset until all screwed up memo fields
have RTF coding on them.

Private Sub Command0_Click()
On Error GoTo p_err
DoCmd.Hourglass True
Application.Echo False
x = 1
crit = "SELECT CLIENTSW.CASENUM, CLIENTSW.SUMMARY FROM CLIENTSW WHERE
(((CLIENTSW.SUMMARY) Not Like ""*rtf*"" And (CLIENTSW.SUMMARY) Is Not
Null));"
Set mdb = CurrentDb()
Set mrs = mdb.OpenRecordset(crit, dbOpenDynaset, dbSeeChanges)
If mrs.EOF And mrs.BOF Then
Else
Dim xz As String
'Font Setting

'Experiment with Font
Me!SUMMARY.rtfText = ""
'Loop through the records
mrs.MoveFirst
    Do While Not mrs.EOF And x < 3000
'Replace the new lines and tabs
        xz = mrs!SUMMARY
        xz = Replace(xz, vbNewLine, "\par ")
        xz = Replace(xz, vbTab, "\tab ")
'Change to RTF text
        Me!SUMMARY.Object.SelText = xz
        Set txtRTF = Me.SUMMARY.Object
'Update the Summary field
        mrs.Edit
        mrs!SUMMARY.Value = txtRTF.rtfText
        txtRTF.rtfText = ""
        mrs.Update
        mrs.MoveNext
        x = x + 1
    Loop
mrs.Close
Set mrs = Nothing
Set mdb = Nothing
End If
DoCmd.Hourglass False
Application.Echo True
MsgBox x
Exit Sub
p_err:
Application.Echo True
MsgBox Err.Description
End Sub



Relevant Pages

  • Re: Lebans RTF2 Control Default Font Microsoft Access 2003
    ... Tonight I posted a new version of the RTF control, ... Default Font property that actually works.. ... The simplest way for you to set all of your exisiting text in the RTF ... > The code selects memo field contents that are missing RTF> coding. ...
    (microsoft.public.access.forms)
  • Re: pretty output using Fortran
    ... but most work in a single font in only 256 colours. ... I'd say writing HTML or RTF is going to be the simplest and clearest. ... HTML is slightly simpler and also probably more portable, since just about everyone has a browser these days but I'm not sure about the automatic availability of something which reads RTF on non-Windows systems. ... But it's going to be harder work for you than writing html, and will mean you can't send your results to a third party who doesn't have Excel. ...
    (comp.lang.fortran)
  • cannot delete SOME text in a footer
    ... the footer there is an inserted Date Field and right up against the right ... side of the date are two characters le (lowercase L followed by lowercase E) ... the le is formatted in italic in a slightly smaller font and I can select it ... Note that just saving as RTF and converting DOES NOT WORK. ...
    (microsoft.public.word.application.errors)
  • Export to RTF
    ... Sans Serif" and replaced it with "Microsoft Sans Serif". ... font is truncated, not the new font. ... >to export to an RTF so they can email it to people. ... >of the fields is a memo field. ...
    (microsoft.public.access.externaldata)
  • Re: Lebans RTF2 Control Default Font Microsoft Access 2003
    ... This is the code behind my button that corrects the non RTF code with RTF ... than the system font, which when brought up in Word shows up as long thin ... The code selects memo field contents that are missing RTF ... Set mdb = CurrentDb ...
    (microsoft.public.access.forms)