I want to locate a file, copy it to another folder, and hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Briansmi1116
    New Member
    • Oct 2007
    • 76

    I want to locate a file, copy it to another folder, and hyperlink

    Hello all,

    I have a button that opens a browse for window, to allow you to find a file and create a hyperlink to that file. This is then placed in a text box. The code I use is:
    Code:
    Private Sub browse_Click()
    
        Me.[Hyperlink].SetFocus
        On Error GoTo browse_stop
        RunCommand acCmdInsertHyperlink
    browse_stop:
      
    End Sub
    I would like to expand this a little. I want to locate a file, no matter where, copy it to a specified folder, and then create a hyperlink to the copied file. I would also like to do more then one hyperlink if at all possible.

    Thanks in advance,

    Brian Smith
    Last edited by JKing; Apr 15 '08, 05:37 PM. Reason: [CODE] Tags
  • aprpillai
    New Member
    • Mar 2008
    • 23

    #2
    Browsing for Files have a look at this link:
    Learn Advanced Microsoft Access Programming Techniques, Tips and Tricks


    Hyperlinks to an External File can be made by setting the Object's (Command Button, Label etc.) Hyperlink Address Property with External File Path.

    Comment

    • Briansmi1116
      New Member
      • Oct 2007
      • 76

      #3
      This is what my code does already, I am wanting the button to not only do this, but to copy the file no matter where it is, and paste it in the folder on the network where all my hyperlink files go. Then hyperlink to it. I also want to expand it to do more then one hyperlink.

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        Originally posted by Briansmi1116
        This is what my code does already, I am wanting the button to not only do this, but to copy the file no matter where it is, and paste it in the folder on the network where all my hyperlink files go. Then hyperlink to it. I also want to expand it to do more then one hyperlink.
        The FileCopy command will allow you to copy and paste a file from a source to a destination. An error will occur if the file is open.

        Here's an example of using the FileCopy statement.

        Code:
        FileCopy "C:\Jared.txt", "C:\Test\Jared.txt"
        C:\Jared.txt is the Source
        C:\Test\Jared.t xt is the Destination

        Hope that helps,

        Jking

        Comment

        • Briansmi1116
          New Member
          • Oct 2007
          • 76

          #5
          That sounds good, but my button only opens a hyperlink browse window. I want to be able to open a browse window, select the file, then make a copy of it and plce it in another folder, then I want it to create a hyperlink to it.

          Comment

          • JKing
            Recognized Expert Top Contributor
            • Jun 2007
            • 1206

            #6
            Originally posted by Briansmi1116
            That sounds good, but my button only opens a hyperlink browse window. I want to be able to open a browse window, select the file, then make a copy of it and plce it in another folder, then I want it to create a hyperlink to it.
            Okay,

            So you want the user to be able to select a file to be copied from a browse file menu.

            Do you want the user to be able to choose a destination path in a similar fashion? Or do you want all files to be copied to the same destination?

            Comment

            • Briansmi1116
              New Member
              • Oct 2007
              • 76

              #7
              yes that is exactly right. I want the file to go to a specified location. But the only other problem I will have is that the text box only allows for one file to be hyperlinked. If there is a way to do multiple hyperlinks that would be great, but if not, I would like to not only hyperlink the file but be able to copy and hyperlink a folder.

              Brian

              Comment

              Working...