how to open enternal text file

  • Thread starter Haggr1 via AccessMonster.com
  • Start date
H

Haggr1 via AccessMonster.com

trying to open an external text file using a command button on a form. Here
is what I have so for:

Call Shell("TEXT.txt \\C:\labels.txt", 1) but I get "file not found"

I am sure it is the "TEXT.txt" that is causing the problem because I was
guessing. Thanks
 
D

Dirk Goldgar

In
Haggr1 via AccessMonster.com said:
trying to open an external text file using a command button on a
form. Here is what I have so for:

Call Shell("TEXT.txt \\C:\labels.txt", 1) but I get "file not
found"

I am sure it is the "TEXT.txt" that is causing the problem because I
was guessing. Thanks

You could shell to Notepad.exe and pass it the path to the file; e.g.,

Shell "Notepad.exe ""C:\labels.txt""", vbNormalFocus

or you could just treat the file path as a hyperlink, and instruct
Access to "follow it":

Application.FollowHyperlink "C:\labels.txt"
 
H

Haggr1 via AccessMonster.com

Notepad.exe worked great

Used "Application.FollowHyperlink" to open a "Cobol" app and it does work,
but I would like to not have to click the "Microsoft Office" warning message
about viruses etc. Thanks

What does "vbNormalFocus" do?

Dirk said:
trying to open an external text file using a command button on a
form. Here is what I have so for:
[quoted text clipped - 4 lines]
I am sure it is the "TEXT.txt" that is causing the problem because I
was guessing. Thanks

You could shell to Notepad.exe and pass it the path to the file; e.g.,

Shell "Notepad.exe ""C:\labels.txt""", vbNormalFocus

or you could just treat the file path as a hyperlink, and instruct
Access to "follow it":

Application.FollowHyperlink "C:\labels.txt"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top