How to use Hyperlink by coding

G

Guest

Hi

Sorry for the other post that did not work ...

Ok Here's my question.

I have a program that is a tool for Curriculum Vitea management. My boss
would like to click on a button that would open the word version (a .doc
file) of a CV. I know that when you create a button ... you always have a
choice in application for MSWord.

If you chose that button and click on it It will open Msword BUT it wont
open any document unless you name the file (and path) directly in the
property Hyperlink of the button.

Does not help because we have over 800 CV in a file. So what I would like is
create a field in wich the user would type the file name

Ex. Field1 : MyCV.doc

Now by programmation I would like that the button open the file name in
Field1 which would give something like

Dim path as string
Dim CVName as string
Dim MyChoice as string

Path = "C:\AllCV\"
CVName = Me![Field1].value
MyChoice= Path & CVName


The problem is to tell to MSWord to open the file initialize in the variable
Mychoice!


Like I said earlier when I create a button for the MSWord application ...
and if I clik on the button it will open msword but not the file ... How can
I do that ?

Any one have a hint ??

Thanks for your Help!

Stephane Pelletier
 
G

Guest

Hi,
you would want to open the files with the FollowHyerplink method (as
described in your earlier post).

Do you want to store the full string path to the external file or do you
just want the user to type it at runtime to open it up?
For the first part...add a table field to your records table of text
datatype. This will store the full strung path and file name to the files.
Then at runtime on the buttons on click event you can reference a control
which is bound to this field e.g.:

Application.FollowHyperlink Me.YourControl

If you want to implement the functionality for the user to choose the file
so thta its filepath will be stored with a record then implement code to open
the standard open dialog e.g.:

http://www.mvps.org/access/api/api0001.htm

This will return the full path and name and you can assign the value to the
bound control you have on the form.
Before executing the FollowHyperlink methods you might also want to
implement a check to see if the file actually exists and if the control you
are referencing holds a value. You can do this with the Len() and Dir()
functions.
HTH
Good luck
 

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

Similar Threads


Top