Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using RTF in FoxPro

Status
Not open for further replies.

LorenC

Programmer
Dec 31, 2002
13
US
This is the first time I have visited this forum. Very impressive guys. Informed and knowledgible.

[xdirect = SYS(5)+SYS(2003)]
[ShellExec(xdirect+"\SCGINS.RTF")]

I have put the command above in my program which calls the API and brings up a word processor. In my case Microsoft Word. It allows you to read the file, modify it or print it.
In this case it is instructions to the program which the clients can read or print out. It works just fine.

My questions is this.
If they don't have word, will it bring up the word processor they have?
If they don't have a word processor will it bring up Wordpad.exe

My thinking is it would bring up what ever is registered as handling rtf files.
Is my thinking off base?

 
No, your thinking is not off base.

Wordpad will be invoked if it's registered
as the app to manipulate rtf files, which by the way,
is standard for the default install.

Darrell 'We all must do the hard bits so when we get bit we know where to bite' :)
 
Hi LorenC and Darrell..

I am wondering what is this command.
I have heard.. SQLEXEC
I have heard.. ShellExecute

ShellExecute syntax is abosolute floated here and this will not give any result .. as posted above. You need a declare statement and assuming that was done and not specified here.. still the syntax does not fit the requirement.

But is it a user defined function.. ShellExec()
Sorry for my ignorance :)
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
Happy New Year [bigears] [party] [2thumbsup]

 
LorenC

My questions is this.
If they don't have word, will it bring up the word processor they have?
If they don't have a word processor will it bring up Wordpad.exe


Word or no Word you can force your RTF file to open in WordPad anyways. I have win'98, Word XP and I created a RTF document. Naturally if I double-click on it, it will open in Word. But if I go to RegEdit (Start-Run -> RegEdit) and go to HKEY_CLASSES_ROOT and find the reference to the .RTF extension, and delete it (Carefull you may not want to do that, but I have). The next time you open the document, since the system doesn't know what to use anymore it will pop-up a window asking you what program to use, and there is an option to also open all documents with that extension with WordPad.exe.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Ramani,
you asked if the above command was a user defined function, Yes it is. Here is the complete call and function. I must give Credit to Rick Strahl, from his book Internet Applications with VFP 6.0
Thanks to all
Loren

xdirect = SYS(5)+SYS(2003)
ShellExec(xdirect+"\SCGINS.RTF")

*********************
FUNCTION Shellexec
*********************
LPARAMETERS lcLink, lcAction, lcParms

lcAction = IIF(EMPTY(lcAction),"Open",lcAction)
lcParms = IIF(EMPTY(lcParms),"", lcParms)

DECLARE integer ShellExecute;
IN shell32.dll ;
integer nWinHandle, ;
string cOperation, ;
string cFileName, ;
string cParameters, ;
string cDirectory, ;
integer nShowwindow

DECLARE integer FindWindow ;
IN WIN32API ;
string cNull, string cWinName

RETURN ShellExecute(FindWindow(0, _screen.Caption), ;
lcAction, lcLink, lcParms, SYS(2023), 1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top