Hyperlink to documents

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName
 
What if there are PDF's as well as word documents?

Ofer said:
You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


Aaron Daniels said:
I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


Aaron Daniels said:
What if there are PDF's as well as word documents?

Ofer said:
You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


Aaron Daniels said:
I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

Ofer said:
Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


Aaron Daniels said:
What if there are PDF's as well as word documents?

Ofer said:
You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


Aaron Daniels said:
I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

Ofer said:
Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


Aaron Daniels said:
What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
I have it working for one button now, but when I try it on the next button it
give an OLE error

Ofer said:
You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


Aaron Daniels said:
I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

Ofer said:
Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


:

What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
Why do you need two buttons?
If in the second button you are trying the first code I propvided you with.
then you need to create a reference to Microsoft Word (Open code, anywhere,
select tools > reference and add from the list Microsoft Word)

--
I hope that helped
Good Luck


Aaron Daniels said:
I have it working for one button now, but when I try it on the next button it
give an OLE error

Ofer said:
You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


Aaron Daniels said:
I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

:

Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


:

What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
I need the same button on a different form and when I try to use the code
below that worked on the first button it will not work. I tried changing
"DocLocationAndName" to "DocLocationAndName1" but that didn't help either.

Private Sub Command74_Click()
Dim DocLocationAndName As String
DocLocationAndName = "j:\werners\hr_secured\resume\" & Me.Link_to_Resume
Application.FollowHyperlink DocLocationAndName
End Sub


Ofer said:
Why do you need two buttons?
If in the second button you are trying the first code I propvided you with.
then you need to create a reference to Microsoft Word (Open code, anywhere,
select tools > reference and add from the list Microsoft Word)

--
I hope that helped
Good Luck


Aaron Daniels said:
I have it working for one button now, but when I try it on the next button it
give an OLE error

Ofer said:
You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


:

I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

:

Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


:

What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
Are you trying to open a different type of file?


Aaron Daniels said:
I need the same button on a different form and when I try to use the code
below that worked on the first button it will not work. I tried changing
"DocLocationAndName" to "DocLocationAndName1" but that didn't help either.

Private Sub Command74_Click()
Dim DocLocationAndName As String
DocLocationAndName = "j:\werners\hr_secured\resume\" & Me.Link_to_Resume
Application.FollowHyperlink DocLocationAndName
End Sub


Ofer said:
Why do you need two buttons?
If in the second button you are trying the first code I propvided you with.
then you need to create a reference to Microsoft Word (Open code, anywhere,
select tools > reference and add from the list Microsoft Word)

--
I hope that helped
Good Luck


Aaron Daniels said:
I have it working for one button now, but when I try it on the next button it
give an OLE error

:

You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


:

I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

:

Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


:

What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 
I've tried the same and different, neither work

Ofer said:
Are you trying to open a different type of file?


Aaron Daniels said:
I need the same button on a different form and when I try to use the code
below that worked on the first button it will not work. I tried changing
"DocLocationAndName" to "DocLocationAndName1" but that didn't help either.

Private Sub Command74_Click()
Dim DocLocationAndName As String
DocLocationAndName = "j:\werners\hr_secured\resume\" & Me.Link_to_Resume
Application.FollowHyperlink DocLocationAndName
End Sub


Ofer said:
Why do you need two buttons?
If in the second button you are trying the first code I propvided you with.
then you need to create a reference to Microsoft Word (Open code, anywhere,
select tools > reference and add from the list Microsoft Word)

--
I hope that helped
Good Luck


:

I have it working for one button now, but when I try it on the next button it
give an OLE error

:

You can create a button on the form, on the Onclick event of the button (Open
the button properties, put the cursor on the OnClick property, on the right
side you'll see a button with three dots, click on it and select code
builder) in there enter the code with the hyperlink

--
I hope that helped
Good Luck


:

I know this is probably a stupid question, but where do I apply this? Do I
need to create a macro and add this script to the macro?

:

Use the FollowHyperlink, it will open any type of file according to the
defenition in you windows

--
I hope that helped
Good Luck


:

What if there are PDF's as well as word documents?

:

You can create a form with a text field to type in the name of the document
and a button, when the user click the button the specific word document will
be open

To open a word document, create reference to Microsoft Word and then add
this code to the OnClick event of the button
=================================
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display

End Function
===========================
Or use the FollowHyperLink

Dim DocLocationAndName as String
DocLocationAndName = "j:\werners\hr_secured\resumes\" & Me.[TextFieldName]
application.FollowHyperlink DocLocationAndName

--
I hope that helped
Good Luck


:

I am trying to create a Hyperlink field that opems documents in a certain
folder
j:\werners\hr_secured\resumes
and allows her to type in the name of the document in the form to complete
the link. If the document was named "test.doc", I'd like for her to be able
to type in "test.doc" in the field and have it link to
j:\werners\hr_secured\resumes\test.doc when she clicks on it. Help would be
greatly appreciated!!!!!!!
 

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

Back
Top