>Thanks Jerry !
>I like your solution. I use RTF activeX but I agree taht it is really hard to achieve with it, such ease of use like in WordPad.
>(BTW I also used general field in the supporting table bound to the olecontrol and still have only icon not file content - probably I set something different than you set. But now I know that it can work so I will find it)
My olebound control is bound to a general field, WordDoc, in a file. The activate event of that pageframe does the trick:
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
ON KEY
THIS.cmdNoteEdit.REFRESH()
THIS.OleWordPad.SETFOCUS()
What is actual displayed in the control, and on the pageframe, is the contents of the gnereal field, WordDoc. I still use the 'RTF' format for the file, but WordPad handles the editing,not the rtf control.
>
>
>>>I tried your solution and I saw two problems (or rather -it seems to me that it can drive an app user to problems ).
>>>1) OleBoundControls shows only WorPadDocument icon ( not content of file)
>>
>>Mine shows content embedded in the page frame. This is because I have a general field in the supporting table, which I call 'WordDoc' and which is bound to the olecontrol. The text in that field shows in the olecontrol.
>>
>>>2) doverb(0) method opens wordpad in another window
>>
>>Mine opens in another window in the edit mode by choice. Besides saving text in the general field I also create an RTF file, which is what gets shown in the WordPad instance. Users can then print directly from the WordPad app or edit using the full power of WordPad. This avoids subclassing the RTF control and being responsible for the font, size, color and print controls in it.
>>When they close WordPad and focus returns to the page frame I make sure the changes are saved in the general field and to the RTF file. Users say they prefer it to the old RTF control. The first call to WordPad is slow, but suceeding calls are very quick.
>>
>>>Is it the way it works for you or maybe I something missed ?
Nebraska Dept of Revenue