Could you point the correspondent object to use Wordpad instead of Windows from VFP?

Hi Experts

Could you point the correspondent object to use Wordpad instead of Word from VFP?

This code opens Word:

oWSH = Createobject("wscript.shell")

Open in new window


What is the correspondent to open WordPad ?

Thanks in advance
Eduardo FuerteAsked:
Who is Participating?
 
pcelbaCommented:
If you are executing the application by "executing" the document file then this invokes an application to which is the file extension assigned. The effect is same as if you were double clicked any "known" file in Windows Explorer.

If WordPad is not used in such file extension assignment then you have to execute it explicitly, e.g.:

RUN /n "C:\Program Files\Windows NT\Accessories\WordPad.EXE" c:\temp\MyDoc.rtf
or
oWSH = Createobject("wscript.shell")
oWSH.Run(["C:\Program Files\Windows NT\Accessories\WordPad.EXE" c:\temp\MyDoc.rtf])

To open an empty new document in WordPad simply remove the file name from above commands.
And remember the WordPad.EXE location may vary.
0
 
Eduardo FuerteAuthor Commented:
Much better to configure it in Windows Explorer to use WordPad.
0
 
Eduardo FuerteAuthor Commented:
Thanks for help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.