Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Hyperlink to documents

Discussion in 'Information Technology' started by Aaron Daniels, Nov 15, 2005.

  1. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    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!!!!!!!
     
  2. Loading...


  3. Ofer

    Ofer
    Expand Collapse
    Guest

    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!!!!!!!
     
  4. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    Guest

    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!!!!!!!
     
  5. Ofer

    Ofer
    Expand Collapse
    Guest

    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!!!!!!!
     
  6. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    Guest

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

    Ofer
    Expand Collapse
    Guest

    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!!!!!!!
     
  8. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    Guest

    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!!!!!!!
     
  9. Ofer

    Ofer
    Expand Collapse
    Guest

    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!!!!!!!
     
  10. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    Guest

    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!!!!!!!
     
  11. Ofer

    Ofer
    Expand Collapse
    Guest

    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!!!!!!!
     
  12. Aaron Daniels

    Aaron Daniels
    Expand Collapse
    Guest

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

Share This Page