Opening Word docs from Form

Dave Eyley

Registered User.
Local time
Today, 05:34
Joined
Sep 5, 2002
Messages
254
I have searched this topic but can't find exactly what I'm looking for so I hope someone help.

I have a directory full of doc files which are constantly being updated. I would want to be able to browse the directory from Access and click on the relevant file to open it directly.

So there's no storing the pathnames in a table etc...just open the doc to view.

Any ideas?

Dave Eyley
 
You can browse the directory from Access and click on the relevant file using API functions and get file path in string(search forum for example)
Then try to use built-in function "Shell" and pass parameters for word.exe and your string.
That should open file directly.
 
Thanks IgorB,

I'll have a look at the Shell function.

I already use the Browse to file function (from this site years ago) but was unable to find any way to open the file from the Browser window directly.
(despite searching the site).

Thanks again.

Dave Eyley
 
The OpenFile() function in my Browse [Find a directory or file] will do exactly what you want. It uses the ShellExecute method which will open any file that the users computer can open. The ShellExecute method does not have the problems that the Shell() function has if the file name or direcotry name contains any spaces. The fFindOpenImportFile form and the fScanDirSelectFileFromTable form in my browsing sample will show you two methods to allow the user to "open" a file with the click of a button. You can easily alter the code to my Browsing... button to open the selected file instead of storing the path in a text box.
 

Users who are viewing this thread

Back
Top Bottom