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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to hyperlink field to open documents? 2

Status
Not open for further replies.

Werneck

Technical User
Joined
Aug 5, 2003
Messages
36
Location
BR

I created an Acc97 mdb to keep track of tons of documents created with several softwares like word, excel, paintbrush, etc. The main form shows records with name of the document, subject, notes, etc. To allow user to open a document I created a hyperlink field. Click on the hyperlink field and the document is opened by Windows with the proper application. If the user changes the name of the document (field Doc), vba code updates the hyperlink (field Link) properly. It works ok.

The solution is convenient because it doesn't need to define the application which will open the document and because it allows user to edit the name of the document.

But it renders the form with two fields containing the name of the document (field Doc and field Link).

Is there a way to open the document without having the hyperlink Link field? Like double click on the field Doc to open a document without defining its application.

Thank you
 
Hi Werneck,

I've got to admit that I find this a strange request. I have a demo that uses the ShellExecute API. The demo is at: and the file to lokk at is CommonDialogAccess97.zip or CommonDialogAccess2000.zip

The demo code is written around the result of a CDC, but can easily be adapted to any other variable.

I really would appreciate a more detailed explanation of what you are trying to do do. Might help me some time in the future. As far as I can see both your existing method and my suggested demo method should do exactly the same thing!!!

Bill
 
Bill

It's really a simple app motivated by the fact the user uses too lengthy file names in order to remember its contents just by looking the Windows Explorer into many project folders. Still is not enough and cause several practical problems to the user, including search for the proper document. Also, backing-up to cdrom with such a lenghty file names is impossible sometimes. I came up with this idea of naming the files with just a sequential number plus extension and have their names and subject in an mdb. The hyperlink is a practical way to open the document (doc, txt, pps, pdf, xls, bmp, html, and whatever might come up) because Windows will associate any document with its app, so I don't have to take care of that or limit my app to previously defined types of documents.

You indicated a very nice and clean code!

Thank you
Cesar
 
Hi Werneck,

Do you need any further help on this. Thanks for the compliment.

Bill
 
Bill

I might need some further help on this in a few weeks. If you have any thoughts on the approach I took, please feel free to comment. I will be away for a week.

Thank you very much!
Cesar
 
Norris68

Your solution is exactly what I had in mind: a code alternative for the field hyperlink using the resources of the OS to open documents of the registered applications.

Thank you very much for your care on reading my stuff and to send the code and examples.

Cesar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top