saving rich text box as plain text 
Author Message
 saving rich text box as plain text

Hello all

I tried to save the contents of a richtextbox control and output it as
txt only not richtext, the helpfile suggest:
richtextbox1.savefile ( commondialog1.filename, rtfText)
This reports an error, it doesn't accept the 'rtfText' part.
How do I get the richtextbox to save plain text?
Many thanks for replies
regards
Al



Wed, 15 Sep 1999 03:00:00 GMT  
 saving rich text box as plain text

Surely someone can offer some help here?

Quote:
>Hello all

>I tried to save the contents of a richtextbox control and output it as
>txt only not richtext, the helpfile suggest:
>richtextbox1.savefile ( commondialog1.filename, rtfText)
>This reports an error, it doesn't accept the 'rtfText' part.
>How do I get the richtextbox to save plain text?
>Many thanks for replies
>regards
>Al



Fri, 17 Sep 1999 03:00:00 GMT  
 saving rich text box as plain text

This code: richtextbox1.savefile(commondialog1.filename, rtfText) will not
work unless you assigning a return value. Try this same code but without
the () around the arguments.

If you know how to get around the .Find method arguments of start, and end,
being integers, let me know.
                                              Thanks,
                                                    cris calhoun



Quote:

> Surely someone can offer some help here?

> >Hello all

> >I tried to save the contents of a richtextbox control and output it as
> >txt only not richtext, the helpfile suggest:
> >richtextbox1.savefile ( commondialog1.filename, rtfText)
> >This reports an error, it doesn't accept the 'rtfText' part.
> >How do I get the richtextbox to save plain text?
> >Many thanks for replies
> >regards
> >Al



Sun, 19 Sep 1999 03:00:00 GMT  
 saving rich text box as plain text

On 2 Apr 1997 22:31:33 GMT "Cris Calhoun"

Quote:
>This code: richtextbox1.savefile(commondialog1.filename, rtfText) will not
>work unless you assigning a return value. Try this same code but without
>the () around the arguments.

>If you know how to get around the .Find method arguments of start, and end,
>being integers, let me know.

You'll probably have to use the Win32 API.  From the Win32 API
refrence, I could figure this out:

type charrange
    cpMin as long
    cpMax as long
end type

type findtext
    chrg as charrange
    lpstrText as string

Quote:
}

Private Declare Function SendMessage& Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam
As Long, lParam As Any)

Use SendMessage with EM_FINDTEXT as the wMsg, the flags (Probably the
same as VB) as wParam, and the findtext structure as lParam.

However, I couldn't find any info on EM_FINDTEXT.  It wasn't listed in
the API viewer that comes with VB 4.0 or the API viewer from the
Visual Basic Programer's Guide the Win32 API.  Does anybody know
anything else about the RichText API?  

phil



Tue, 21 Sep 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Saving Rich Text Box Control as PLAIN TEXT!!!!

2. Creating e-mail is always Rich Text NOT Plain Text

3. Mapping plain text to rich text?

4. Rich Text Box: Can I remove text and keep multicolored text

5. Colour Text Box/Class Wrapper for Rich Text Box

6. Newbie question: Rich Text Box vs. Text Box

7. help: formatting rich text box/text box

8. Rich Text Box vs. Text Box Scrolling

9. Rich Text Box or text box control

10. Looking for APIs for text box and Rich text box

11. opening / saving files with MS rich text box control (viewing open files)

12. Rich Text Box Saving problem

 

 
Powered by phpBB® Forum Software