Word Macro to Open PDF

  • I have a drop down menu that I have created in Word which I would like to attach macro's to. Each macro will point to a different PDF file, so when the user clicks the menu option it will open the specific PDF.


    I have found the code below. It seems to work, but when I go to try and attach it it is not in my list of macro's. How do I get it to show in my list. Will I need to create a new module for each PDF macro if I use the below code? What I would like is one module, but the code repeated and only the file path for each macro will be changed. Hope that make sense.

  • Re: Word Macro to Open PDF


    Please take the time to actually read the Forum Rules that you have agreed to.


    Specifically all code should be enclosed with Code tags


    That is code for the Open event of the Documnet.


    Simpler would be to use the FollowHyperlink method

    Code
    ActiveDocument.FollowHyperlink Address:="file:C:\Users\user name here\Documents\your pdf name here.pdf"

    you can use button or a shape to run the code.


    Also, a simple hyperlink attached to a shape wouldn't need VBA

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!