
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