Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RTF Control for Word Processing?
Message
 
To
03/01/2002 17:51:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00600542
Message ID:
00600848
Views:
21
>Is there a good control that would allow the display and edit of features such as bolding / underlining / font sizing so that a word processed document could be stored in a memo field? I assume it would be storing rich text format (RTF).

I use an rtf formatted file but access it with WordPad, which eliminates having to make sure the proper RTF control is on the target PC. Everyone has WordPad, but not everyone has the same version of RTF control (dll, vcx, version incompatibilites, inability to install proper rtf control without rebuilding box,etc...)

Some assoicated code, using the oleboundcontrol for wordpad:
stfile = 'NOTES\I'+RIGHT(ALLTRIM(STR(nSSN)),7)+".rtf"
IF FILE(stfile)
	=MESSAGEBOX(stfile+ " already exists!")
	This.Parent.cmdNoteEdit.ENABLED = .T.
	This.Parent.cmdNoteEdit.SetFocus()
	RETURN
ENDIF
fh = FCREATE(stfile,0)
IF fh = -1
	=MESSAGEBOX("Error creating "+stfile+" !")
	RETURN
ENDIF
=FCLOSE(fh)
APPEND GENERAL WordDoc LINK FROM &stfile CLASS "WordPad.Document"
'WordDoc' is a field in the table where the text can be stored, in addition or exlusion to the external rtf file.

To enter the edit mode using WordPad do:
This.Parent.OleWordPad.DoVerb(0)
The WordPad OLE is on a tab by itself and I have this code in the Activate event for the tabframe.
WITH THISFORM
	.PrevPage = 3
	.LOCKSCREEN = .T.
	.cmdFirst.ENABLED = .F.
	.cmdPrev.ENABLED = .F.
	.cmdNext.ENABLED = .F.
	.cmdLast.ENABLED = .F.
	SELECT Persinfo
	LOCAL stfile
	THIS.PARENT.Personal.txtSsn.REFRESH()
	stfile = 'NOTES\I'+RIGHT(ALLTRIM(STR(THIS.PARENT.Personal.txtSsn.VALUE)),7)+".rtf"
	IF FILE(stfile)
		APPEND GENERAL WordDoc LINK FROM &stfile CLASS "WordPad.Document"
		THIS.cmdNoteEdit.ENABLED = .T.
	ELSE
		APPEND GENERAL WordDoc
		THIS.cmdNoteEdit.ENABLED = .F.
	ENDIF
	THIS.OleWordPad.REFRESH()
	.LOCKSCREEN = .F.
ENDWITH
Nebraska Dept of Revenue
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform