Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RTF Control for Word Processing?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00600542
Message ID:
00602402
Vues:
28
Thanks !
I'll try to mimic your code.


>My olebound control is bound to a general field, WordDoc, in a file. The activate event of that pageframe does the trick:
>
>* ThisForm.PgfHm1.Notes.Activate()
>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 ?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform