dbTalk Databases Forums  

HELP: Problem with rich text box

comp.databases.ms-access comp.databases.ms-access


Discuss HELP: Problem with rich text box in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mel
 
Posts: n/a

Default HELP: Problem with rich text box - 01-05-2005 , 08:38 AM






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



Reply With Quote
  #2  
Old   
Phil Stanton
 
Posts: n/a

Default Re: Problem with rich text box - 01-05-2005 , 10:48 AM






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

Quote:
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





Reply With Quote
  #3  
Old   
Mel
 
Posts: n/a

Default Re: Problem with rich text box - 01-05-2005 , 11:04 AM



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

Quote:
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







Reply With Quote
  #4  
Old   
Stephen Lebans
 
Posts: n/a

Default Re: Problem with rich text box - 01-05-2005 , 03:29 PM



The RTF control has a Text property. Create and Unbound TextBox control
and set its Value property ot the Text property of a hidden/invisible
RTF control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Mel" <mbourbon (AT) NOSPAMcae (DOT) com> wrote

Quote:
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








Reply With Quote
  #5  
Old   
David Schofield
 
Posts: n/a

Default Re: HELP: Problem with rich text box - 01-07-2005 , 11:33 AM



On Wed, 5 Jan 2005 09:38:01 -0500, "Mel" <mbourbon (AT) NOSPAMcae (DOT) com>
wrote:

Quote:
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
Doesn't the control have a Text property? The .NET one has. You can
use this maybe to store a text-only version of the field in another
column in the table.
David



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.