Results 1 to 5 of 5
  1. #1
    sud2017 is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Jul 2017
    Posts
    148

    How to open an External PDF/Word file from a FORM

    Hi Guys,



    Need help on my form:

    Q1: I have created a FORM that allows me to perform cost estimation for different opportunities my company quote for. I want a command button in my form that would open up an external WORD document from our network directory. How can I do this?

    Q2: Is it possible to include OUTPUT from my cost estimation FORM to the external document that opens up from Q1. For example, I want to include a few cost elements in a page of Quotation file that is preformatted and will open up from Q1.


    Thanks in advance for any possible help.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Q1: Get the file name - open the Browse window if you don't have it stored. Use the Application.FollowHyperlink command to open the file.
    Q2: You will need to open the file, make modifications to it, save it, then open it.

  3. #3
    sud2017 is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Jul 2017
    Posts
    148
    Thanks for the directions. I got this code on a command button which isn't opening up the file. Further guidance will be much appreciated.

    Private Sub CmdOpenAttach_Click()
    Dim rs As DAO.Recordset
    Set rs = Me.RecordsetClone
    OpenFirstAttachmentAsTempFile rs, "P:\14-01-16 Project Planning Board.xlsx"
    End Sub

    Quote Originally Posted by aytee111 View Post
    Q1: Get the file name - open the Browse window if you don't have it stored. Use the Application.FollowHyperlink command to open the file.
    Q2: You will need to open the file, make modifications to it, save it, then open it.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I don't know what you are trying to do here. This code is using the recordset from the form. To open a file: Application.FollowHyperlink "P:\14-01-16 Project Planning Board.xlsx"

  5. #5
    sud2017 is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Jul 2017
    Posts
    148
    Thanks Got it. Sorry for the confusion, I had got a wrong code from somewhere. Thanks again.

    Quote Originally Posted by aytee111 View Post
    I don't know what you are trying to do here. This code is using the recordset from the form. To open a file: Application.FollowHyperlink "P:\14-01-16 Project Planning Board.xlsx"

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

Similar Threads

  1. Open external program and file using VBA
    By bid19123 in forum Programming
    Replies: 2
    Last Post: 09-21-2016, 02:15 PM
  2. Open external file with command button
    By bradp1979 in forum Programming
    Replies: 47
    Last Post: 08-20-2015, 05:33 PM
  3. Replies: 3
    Last Post: 02-22-2013, 06:41 AM
  4. Open word file off Access form
    By BorisGomel in forum Access
    Replies: 8
    Last Post: 07-12-2012, 12:01 PM
  5. How to open a word/excel/other file in vba
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 10:36 PM

Tags for this Thread

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