Rich Text Box - creating text 
Author Message
 Rich Text Box - creating text

How do I add elements like the rich text \tab command programmatically to
the contents of a rich text box control?

If I do this:

    * format the new string
    newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

    * add the text
    thisform.rtc.seltext = (newstring)

Then look at the resulting string, it displays:

    '\\par Date: 01/01/2001\\tab Time: 08:23:34'

How can I insert a TAB ???

Thanks!

Mike Lenoir



Sat, 16 Aug 2003 06:29:24 GMT  
 Rich Text Box - creating text

says...

Quote:
>     * add the text
>     thisform.rtc.seltext = (newstring)

> Then look at the resulting string, it displays:

>     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

Have you tried .SelRTF instead of .SelText?


Sat, 16 Aug 2003 05:15:43 GMT  
 Rich Text Box - creating text
Try This

thisform.rtc.seltext = chr(9)

Jomy John


Quote:
> How do I add elements like the rich text \tab command programmatically to
> the contents of a rich text box control?

> If I do this:

>     * format the new string
>     newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

>     * add the text
>     thisform.rtc.seltext = (newstring)

> Then look at the resulting string, it displays:

>     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> How can I insert a TAB ???

> Thanks!

> Mike Lenoir




Sat, 16 Aug 2003 05:20:43 GMT  
 Rich Text Box - creating text
Try This

thisform.rtc.selRTF = chr(9)

Jomy John


Quote:
> How do I add elements like the rich text \tab command programmatically to
> the contents of a rich text box control?

> If I do this:

>     * format the new string
>     newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

>     * add the text
>     thisform.rtc.seltext = (newstring)

> Then look at the resulting string, it displays:

>     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> How can I insert a TAB ???

> Thanks!

> Mike Lenoir




Sat, 16 Aug 2003 05:21:47 GMT  
 Rich Text Box - creating text
Try This

thisform.rtc.selRTF = chr(9)

Jomy John


Quote:
> How do I add elements like the rich text \tab command programmatically to
> the contents of a rich text box control?

> If I do this:

>     * format the new string
>     newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

>     * add the text
>     thisform.rtc.seltext = (newstring)

> Then look at the resulting string, it displays:

>     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> How can I insert a TAB ???

> Thanks!

> Mike Lenoir




Sat, 16 Aug 2003 05:21:29 GMT  
 Rich Text Box - creating text
Try +CHR(9)


Quote:
> How do I add elements like the rich text \tab command programmatically to
> the contents of a rich text box control?

> If I do this:

>     * format the new string
>     newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

>     * add the text
>     thisform.rtc.seltext = (newstring)

> Then look at the resulting string, it displays:

>     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> How can I insert a TAB ???

> Thanks!

> Mike Lenoir




Sat, 16 Aug 2003 05:19:33 GMT  
 Rich Text Box - creating text
Thanks. That DOES allow me to insert a tab. However, it doesn't help on \par
and other rich text strings...


Quote:
> Try +CHR(9)



> > How do I add elements like the rich text \tab command programmatically
to
> > the contents of a rich text box control?

> > If I do this:

> >     * format the new string
> >     newstring = '\par '+'Date: '+dtoc(date())+'\tab '+'Time: '+time()

> >     * add the text
> >     thisform.rtc.seltext = (newstring)

> > Then look at the resulting string, it displays:

> >     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> > How can I insert a TAB ???

> > Thanks!

> > Mike Lenoir




Sat, 16 Aug 2003 07:59:54 GMT  
 Rich Text Box - creating text
Garrett,

Great idea, but it still doesn't work for me.

I just changed seltext to selrtf.

Am I doing something wrong?


Quote:

> says...
> >     * add the text
> >     thisform.rtc.seltext = (newstring)

> > Then look at the resulting string, it displays:

> >     '\\par Date: 01/01/2001\\tab Time: 08:23:34'

> Have you tried .SelRTF instead of .SelText?



Sat, 16 Aug 2003 07:59:00 GMT  
 Rich Text Box - creating text
Michael,

I was exactly where you were about 6 months ago and got everything to work just
great.  I'm not in the office now so I can't give you the details and answers
on what you are trying to do.  But, I can tell you this, I'm assuming you are
using the Microsoft RichTx32 ActiveX control.  If so, you are facing a "dead
end."  It's great for simple things but you will really hit the wall when you
try to create a Page Break.  It appears that the Microsoft Rich Text control is
compatible with the same as in WordPad.  But, try and do a page break, headers,
footers, tabs (setting a tab) and you really are in for a monster.

I even tried to go into Microsoft Word and save the document in Rich Text
format and then load it up in the ActiveX control and many things are ignored
like Page Breaks.  Almost as if there is a rich rich text or something.

Anyways, I don't know what you are trying to do or how sophisticated your
document processing needs to be.  But, if you want something that works, see
http://www.textcontrol.com

That's what I'm using and it's much better.  Yes, you will have to shell out a
good chunk of change but it's the best I have found so far.  It's not perfect
and there are some "quirks" but I have gotten it to do what I want.

The only other solution that I know of would be to use ole Automation with
Microsoft Word but that assumes that they must have Word on their machine and
your app is no longer "self contained."

Regards,

Quote:
>Subject: Re: Rich Text Box - creating text

>Date: 02/26/2001 3:59 PM Pacific Standard Time

>Garrett,

>Great idea, but it still doesn't work for me.

>I just changed seltext to selrtf.

>Am I doing something wrong?

Mike


Sat, 16 Aug 2003 09:05:49 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Rich Text Nightmare (merging two rich text files)

2. Utility to convert 2 digit year text boxes into 4 year digit text boxes

3. Clipboard operations in Rich Text box ActiveX control

4. Rich Text Box Problem ....

5. <> Transparent Rich Text Box

6. Problem with Rich Text Box

7. Spell checking in a Rich Text control box

8. about Rich Text Box Control

9. about Rich Text Box Control

10. create text file using text...endtext

11. Wrapping text in a text box?

12. Large Text box in Report from text file??

 

 
Powered by phpBB® Forum Software