![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, When you use a RichText box (I'm using Microsoft Control VB 6.0, OLE Class: RichtextCtrl) It is possible to store only the text in the table instead of the rft format? The problem is when you generate the report, it takes data from tables that now have all the RFT format code, like the following: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 test It is so stupid! Mel, Montreal |
#3
| |||
| |||
|
|
I don't know if this is any help, but I had a similar problem using Stephen Leban's RTF2 Control I still wanted the report to have an RTF control, but a different size font. This function reduces (increases) the font by a fixed percentage(Amount = 20 reduces to approximately 20% of original) NO GUARANTEES Function ChangeRTFFontSize(RTFIn As String, Amount As Integer) As String Dim TempStg As String, TempStgIn As String, TempStgOut As String Dim i As Integer, j As Integer, k As Integer Dim NumCount As Integer ' numeric count Dim LengthChange As Integer ' lengthened or shortened Dim LengthShort As Integer For i = 1 To Len(RTFIn) i = InStr(i, RTFIn, "\fs") ' Find font size setting If i > 0 Then NumCount = 0 For k = i + 3 To i + 6 If IsNumeric(Mid(RTFIn, k, 1)) Then NumCount = NumCount + 1 ' How many numbers End If Next k TempStgIn = Mid(RTFIn, i, NumCount + 3) ' the 4, 5 or 6 figures ' Reduce the font size by amount percentage TempStgOut = Mid(RTFIn, i, 3) & CStr(CInt(Mid(RTFIn, i + 3, NumCount)) * Amount \ 100) LengthChange = LengthChange + Len(TempStgOut) - Len(TempStgIn) ' Is it shorter or longer TempStg = TempStg & Mid(Replace(RTFIn, TempStgIn, TempStgOut, , , vbTextCompare), j + 1, i + 3 + NumCount - j) End If If i <= j Then Exit For j = i + 3 + NumCount ' move along 4, 5 or 6 letters Next LengthShort = Len(RTFIn) - Len(TempStg) + LengthChange If LengthShort <> 0 Then TempStg = TempStg & Right(RTFIn, LengthShort) ' missing bits at end End If ChangeRTFFontSize = TempStg End Function "Mel" <mbourbon (AT) NOSPAMcae (DOT) com> wrote in message news:crgu49$5os$1 (AT) dns3 (DOT) cae.ca... Hi, When you use a RichText box (I'm using Microsoft Control VB 6.0, OLE Class: RichtextCtrl) It is possible to store only the text in the table instead of the rft format? The problem is when you generate the report, it takes data from tables that now have all the RFT format code, like the following: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 test It is so stupid! Mel, Montreal |
#4
| |||
| |||
|
|
Thank you but I only need to display the text without any formating on the report. the RichText control store all the RFT code in the tables, I want it to act a bit like a TextBox. "Phil Stanton" <discussion (AT) stantonfamily (DOT) co.uk> wrote in message news:41dc1ab9$0$10791$65c69314 (AT) mercury (DOT) nildram.net... I don't know if this is any help, but I had a similar problem using Stephen Leban's RTF2 Control I still wanted the report to have an RTF control, but a different size font. This function reduces (increases) the font by a fixed percentage(Amount = 20 reduces to approximately 20% of original) NO GUARANTEES Function ChangeRTFFontSize(RTFIn As String, Amount As Integer) As String Dim TempStg As String, TempStgIn As String, TempStgOut As String Dim i As Integer, j As Integer, k As Integer Dim NumCount As Integer ' numeric count Dim LengthChange As Integer ' lengthened or shortened Dim LengthShort As Integer For i = 1 To Len(RTFIn) i = InStr(i, RTFIn, "\fs") ' Find font size setting If i > 0 Then NumCount = 0 For k = i + 3 To i + 6 If IsNumeric(Mid(RTFIn, k, 1)) Then NumCount = NumCount + 1 ' How many numbers End If Next k TempStgIn = Mid(RTFIn, i, NumCount + 3) ' the 4, 5 or 6 figures ' Reduce the font size by amount percentage TempStgOut = Mid(RTFIn, i, 3) & CStr(CInt(Mid(RTFIn, i + 3, NumCount)) * Amount \ 100) LengthChange = LengthChange + Len(TempStgOut) - Len(TempStgIn) ' Is it shorter or longer TempStg = TempStg & Mid(Replace(RTFIn, TempStgIn, TempStgOut, , , vbTextCompare), j + 1, i + 3 + NumCount - j) End If If i <= j Then Exit For j = i + 3 + NumCount ' move along 4, 5 or 6 letters Next LengthShort = Len(RTFIn) - Len(TempStg) + LengthChange If LengthShort <> 0 Then TempStg = TempStg & Right(RTFIn, LengthShort) ' missing bits at end End If ChangeRTFFontSize = TempStg End Function "Mel" <mbourbon (AT) NOSPAMcae (DOT) com> wrote in message news:crgu49$5os$1 (AT) dns3 (DOT) cae.ca... Hi, When you use a RichText box (I'm using Microsoft Control VB 6.0, OLE Class: RichtextCtrl) It is possible to store only the text in the table instead of the rft format? The problem is when you generate the report, it takes data from tables that now have all the RFT format code, like the following: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 test It is so stupid! Mel, Montreal |
#5
| |||
| |||
|
|
Hi, When you use a RichText box (I'm using Microsoft Control VB 6.0, OLE Class: RichtextCtrl) It is possible to store only the text in the table instead of the rft format? The problem is when you generate the report, it takes data from tables that now have all the RFT format code, like the following: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 test It is so stupid! Mel, Montreal Hi |
![]() |
| Thread Tools | |
| Display Modes | |
| |