Open any file from VBA

Posted on 2012-08-10
Last Modified: 2012-08-11
I have a scanned documents folder that can contain for a customer Word files, pdfs, Excel, text files.  These appear is a listbox  on an Access 2003 from - however, if the user wants to view the file, is there a universal open command that will open the file without having to create an application object?  Right now, there is a ShellEx module that uses ShellExecute and ShellExecuteForExplore apis, but it does not work.

Question by:ssmith94015
    LVL 61

    Accepted Solution

    Application.FollowHyperlink lstListbox

    Open in new window

    (Place that in the listbox's double click event)

    Author Closing Comment

    This is so MUCH simpler!  It worked on all the file types, thank you.


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    This collection of functions covers all the normal rounding methods of just about any numeric value.
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now