A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hyperlink to documents



 
 
Thread Tools Display Modes
  #11  
Old November 14th, 2005, 08:22 PM
Aaron Daniels
external usenet poster
 
Posts: n/a
Default Hyperlink to documents

I've tried the same and different, neither work

"Ofer" wrote:

Are you trying to open a different type of file?


"Aaron Daniels" wrote:

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" wrote:

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" wrote:

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

"Ofer" wrote:

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" wrote:

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" wrote:

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" wrote:

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

"Ofer" wrote:

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" wrote:

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!!!!!!!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Master/Outline documents of substantial length Word Heretic General Discussion 2 September 13th, 2005 01:17 AM
Problems merging multiple Word documents Tevibear General Discussion 2 June 26th, 2005 12:27 AM
How do I get all hyperlink fields to use the base hyperlink inst.. daddyman Database Design 0 January 19th, 2005 07:27 PM
Keeping a hyperlink fresh Hari New Users 13 July 20th, 2004 06:34 AM
Two versions again-language issue Otto Setup, Installing & Configuration 3 May 28th, 2004 04:57 AM


All times are GMT +1. The time now is 10:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.