>Hi,
>
>I would like to be able to open up a text file from a VFP 7 form. I'm able to do so using this code:
>
>
>LOCAL lcFile
>
>lcFile = THIS.txtResults.Value
>
>IF !EMPTY(lcFile) AND FILE(lcFile) AND UPPER(JUSTEXT(lcFile)) == "TXT"
> lcFile = "notepad " + lcFile
> RUN &lcFile
>ENDIF
>
>
>However, when the above code is run you get the text file opened in notepad but you can see a DOS window in the background until you close the file. Is there any way you can do this without showing the DOS window?
>
>Thanks,
>Chris
If you want it simple you can just include the /n parameter in the run command
RUN /n &lcFile
But I would suggest you use the ShellExecute command
DECLARE INTEGER ShellExecute IN SHELL32 ;
INTEGER hwnd, ;
STRING Operation, ;
STRING File, ;
STRING Para, ;
STRING Direct, ;
INTEGER Show
lcFile = THIS.txtResults.Value
=ShellExecute(0, 'Open', lcFile,'','',5)
Charles
"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers