# Open a file (any extension) on a local or network drive

**URL:** <https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588>\
**Category:** questions\
**Tags:** windows, winapi\
**Created:** [October 7, 2020, 1:56pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588 "2020-10-07T13:56:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwstone](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/f05b48/32.png) [@dwstone](https://clarionhub.com/u/dwstone)\
**Post date:** [October 7, 2020, 1:56pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/1 "2020-10-07T13:56:55Z")

</div>

How can I open a file with any extension through Clarion? I am able to save a file via FileDialog. But now I need to be able to open the file - preferably, without revealing the location of the file.

---

<div class="post-metadata">

**Author:** ![pbouma](https://clarionhub.com/letter_avatar_proxy/v4/letter/p/d6d6ee/32.png) [@pbouma](https://clarionhub.com/u/pbouma)\
**Post date:** [October 7, 2020, 2:12pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/2 "2020-10-07T14:12:04Z")

</div>

ShellExecute - for handcoders  
Most of the time I use SHELLEX.TPL -Template from SterlingData - easy

> **[Clarion Software Free Download Page #1](https://sterlingdata.com/clarion-software-free-download/)**
>
> This is a clarion software free download page.   If you have any Clarion free software you would like to share with the Clarion software community please send it to me using mike at sterlingdata dot com.

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [October 8, 2020, 4:06pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/3 "2020-10-08T16:06:26Z")

</div>

What sort of “OPEN” do you have in mind?

If you mean OPEN a file inside of clarion?  
then Use the DOS driver

If you mean  
OPEN like double clicking on it in windows explorer  
use ShellExcecute as Piet suggested

---

<div class="post-metadata">

**Author:** ![dwstone](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/f05b48/32.png) [@dwstone](https://clarionhub.com/u/dwstone)\
**Post date:** [October 9, 2020, 6:49pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/4 "2020-10-09T18:49:53Z")

</div>

I was referring to just opening a file (like a Word document) saved on local or network.

I was able to figure it out by using a CapeSoft HyperActive Control. It was super easy.

Thanks.

---

<div class="post-metadata">

**Author:** ![Graham\_Dawson](https://clarionhub.com/user_avatar/clarionhub.com/graham_dawson/32/1331_2.png) [@Graham\_Dawson](https://clarionhub.com/u/Graham_Dawson)\
**Post date:** [October 10, 2020, 2:00pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/5 "2020-10-10T14:00:44Z")

</div>

If you’re using a later release of Clarion then the RUN command will open any file with the application that’s associated with the file extension, so

RUN(‘c:\yourFolder\yourFile.DOCX’,1)

will open yourFile.DOCX with (by default) Word

---

<div class="post-metadata">

**Author:** ![dwstone](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/f05b48/32.png) [@dwstone](https://clarionhub.com/u/dwstone)\
**Post date:** [October 13, 2020, 6:02pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/6 "2020-10-13T18:02:17Z")

</div>

Good to know. Thanks.

---

<div class="post-metadata">

**Author:** ![Liebo](https://clarionhub.com/user_avatar/clarionhub.com/liebo/32/4823_2.png) [@Liebo](https://clarionhub.com/u/Liebo)\
**Post date:** [September 19, 2024, 7:09am UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/7 "2024-09-19T07:09:46Z")

</div>

Thanks PBOUMA ii is now 4 jrs later and it still help people.  
I battled with this specific uissue and got your download link.  
Thanks a lot , make life so much easy.

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [September 20, 2024, 3:46pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/8 "2024-09-20T15:46:55Z")

</div>

> [@Graham\_Dawson](#):
>
> If you’re using a later release of Clarion then the RUN command will open any file with the application that’s associated with the file extension, so
> 
> RUN(‘c:\yourFolder\yourFile.DOCX’,1)
> 
> will open yourFile.DOCX with (by default) Word

You can call the Windows API function FindExecutableA() to check if there is a program registered to handle the File Extension for Open so you can show a nice message. Shell Execute will return the same No Association error.

I would not call RUN with (,1) to wait on something like a Word document that would cause your program to go Not Responding.

> **[FindExecutableA function (shellapi.h) - Win32 apps](https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-findexecutablea)**
>
> Retrieves the name of and handle to the executable (.exe) file associated with a specific document file. (ANSI)

---

<div class="post-metadata">

**Author:** ![Dirk1](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/977dab/32.png) [@Dirk1](https://clarionhub.com/u/Dirk1)\
**Post date:** [September 21, 2024, 3:24pm UTC](https://clarionhub.com/t/open-a-file-any-extension-on-a-local-or-network-drive/3588/9 "2024-09-21T15:24:20Z")

</div>

> [@CarlBarnes](#):
>
> call RUN with (,1)

In my case using RUN with (,1) with a file ext which is not associated to a program, a windows dialog will be shown (fast) to choose a program for association. Not a bad idea i suppose
