Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetFileOpenName function

153 views
Skip to first unread message

Lawrence

unread,
May 18, 1998, 3:00:00 AM5/18/98
to

Dear all,
I have tried out the GetFileOpenName function in an attempt to open any
system applications (i.e. Word, Excel documents and so on). With this
function I had no problem in opening a system Open File box. However, as I
opened the file with a function FileOpen(docname) in the script, nothing
appeared on the screen.

I'll be so pleased if anybody could help.

Thanks a lot!

Simon

unread,
May 19, 1998, 3:00:00 AM5/19/98
to

Assuming the document is a registered file type (.doc, .xls, etc), try
Run(docname)

Lawrence wrote in message <01bd82e2$bfe33440$c3e8...@aslhk.asl.com.hk>...

Mahendra Dhamdhere

unread,
May 19, 1998, 3:00:00 AM5/19/98
to

Check the return value of fileopen.
If it is -1, then check the following.
Is your docname contains full qualified path only just filename.
If it is only filename, then it will not work.( only with pb 6.0 , in pb
5.0 it works )
For pb 6.0, it needs full qualified path for any file.

--
Mahendra Dhamdhere
Unicef, New York.
Email: nospam_m...@hotmail.com
Remove nospam_ from email id.

Thomas Kellerer

unread,
May 22, 1998, 3:00:00 AM5/22/98
to

GetFileOpenName will only return the filename the user selected. It will not
open the associated Application.
If you want to open the registered Application you have to use the
ShellExecute API function
You have to declare a local external function
FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string lpFile,
string lpParameters, string lpDirectory, int nShowCmd ) LIBRARY "shell32.dll"


Call it from within a command button

ShellExecuteA(Handle(Parent), "open", "c:\temp\MyDoc.doc", "", "", 0)

(replace c:\temp\MyDoc.doc with a variable which holds the name returned by
the GetfileOpen function)

Regards
Thomas


Lawrence wrote:

> Dear all,
> I have tried out the GetFileOpenName function in an attempt to open any
> system applications (i.e. Word, Excel documents and so on). With this
> function I had no problem in opening a system Open File box. However, as I
> opened the file with a function FileOpen(docname) in the script, nothing
> appeared on the screen.
>
> I'll be so pleased if anybody could help.
>
> Thanks a lot!

--
==========================================================
Who is user GENERAL FAILURE and why is he reading my disk?

0 new messages