Results 1 to 7 of 7
  1. #1
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67

    FollowHyperlink Help

    I have a command button to open files pertaining to lines of data in my database - it works great - assuming I know what kind of file extension the documentation will be. Unfortunately users may be saving documentation with a standardized naming convention but with an infinite number of extensions.

    Is there a way I could code this so that it will open any file with the name associated with the file regardless of what program the documentation was saved as?

    Below is the code for my command button;



    Private Sub Command2_Click()


    Application.FollowHyperlink "S:\_Activations\Authentication Docs\" & Me.PaymodeID & "_co.doc"
    End Sub

  2. #2
    irish634 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    48
    Look at using FileSystemObjects. You can loop through folders and files then extract extensions and file names, to open what you want.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Quote Originally Posted by RachelBedi View Post
    I have a command button to open files pertaining to lines of data in my database - it works great - assuming I know what kind of file extension the documentation will be. Unfortunately users may be saving documentation with a standardized naming convention but with an infinite number of extensions.

    Is there a way I could code this so that it will open any file with the name associated with the file regardless of what program the documentation was saved as?

    Below is the code for my command button;



    Private Sub Command2_Click()
    Application.FollowHyperlink "S:\_Activations\Authentication Docs\" & Me.PaymodeID & "_co.doc"
    End Sub
    Your code is assuming/assigning an extension of "_co.doc"

    If the users are storing all sorts of extensions, and you go for that, then why not let them pass the entire filename with extension?
    If there is an assignment/association to open extension xxx with program yyy, that may work.

    Another option is to allow them to send you files in format a, b or c. I'm sort of from the school , you use a, but times are changing.

    Users should not be allowed to dream up any extension they please. It sounds (based on the folder Authentication..) that this should be standardized.
    Do you have a data management, information management, standards Policy unit, or someone who thinks they "manage" such an organization.

    Standards, with a limited number of justified options, would seem to resolve this.

    Just a few ramblings.

  4. #4
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    Hi Orange - I would love to be able to tell them that they can only save documentation in one format ie. PDF unfortunately that would be a lot of change for this department very fast.

    The best I think could happen is there would be two options - either PDF or paint (to save screen shots)

    Any other suggestions? FileSystemObject seems to be the best bet but will take a lot more research for me to figure out how to use it.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    How do you create pdfs now?

    Your code was showing .doc
    so how does doc(Word) fit with pdf

    I have a free pdf creator (I'm not really recommending this approach) as a print driver. It saves "prints (screens, diagrams..) as a pdf.

    You could probably make a "quasi" business case rthat multiple formats are causing grief, and money (people's time, ...).

    Does everybody get to make changes to the production database design???

    You could give them a list of formats from which they could select pdf, doc, jpg

    You know the issue and the players.

  6. #6
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    rather than using this I went with adding a browse button to capture the hyperlink and store the hyperlink in the table and form

    Credit goes to;

    http://bytes.com/topic/access/insigh...hyperlink-form

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Glad you have it solved. Thanks for posting yout solution.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Application.FollowHyperlink throwing Exception
    By Mnelson in forum Programming
    Replies: 4
    Last Post: 03-19-2015, 02:13 PM
  2. Reference is not valid FollowHyperlink error
    By kevint_cnc in forum Access
    Replies: 2
    Last Post: 09-04-2012, 02:22 AM
  3. Set IE window size using followhyperlink
    By AndrewAfresh in forum Access
    Replies: 0
    Last Post: 11-23-2006, 12:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums