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.
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