Open PDF File with VBA

MS Office Access


  • 1. get a reference on a form by using form's name
    I'm trying to use a form name as a parameter to use it when this form is opened to recalculate it from another (modal) form. I have just the one modul form. But, to be recalculated forms can be different. This is why I'd like to get a reference to know which one is opened. Dim strFormName As String Private Sub Form_Load() strFormName = Trim(Me.Name) fnFormName(strFormName) End Sub But, how is it possibleto get the reference on that to be recalculated form? In the modal form something like the following: [Forms]![& strFormName &].Recalc - unfortunately, it's not working Thanks
  • 2. Windows desktop properties and an Access 2003 Runtime Application
    I've packaged a runtime application using MS Access 2003 and the develeper extensions available in Visual Tools. When I install my application on a target machine, the menu's in the application are not displaying all of the options (I think the runtime version has reverted back to the Access default, where only the most recently used menu options are visible). Is there any way I can change this ? I also note that the application background colour is not being picked up from the windows desktop properties on the target machine (instead it just displays a grey colour, which I assume is the default). Is there any way to change this? Any help on Access runtime or Windows Package Installer is also much appreciated. Regards Byz
  • 3. How do I get a file's date modified ?
    I want to get the Access back end's last date modified and display it in the front end db, so users can the date when they start the app. Thanks -- Harvest Data Systems

Open PDF File with VBA

Postby Alan Z. Scharf » Wed, 02 Jul 2008 07:38:34 GMT


Can anyone please help me with code to open an existing PDF file withVBA?



Re: Open PDF File with VBA

Postby Douglas J. Steele » Wed, 02 Jul 2008 08:01:07 GMT

Application.FollowHyperlink "C:\Folder\File.pdf"

Doug Steele, Microsoft Access MVP
(no private e-mails, please)

Similar Threads: pdf file through vba

2.Opening PDF file from VBA code in Win98

Hi all,
i need to open a PDF file via VBA code.
In Win2000/XP i'm able to do it with:
                ret = Shell(Environ$("COMSPEC") & " /c """ & list3.Column(3)
& """")
but it doesn't work in Win98, i think cause '' doesn't to handle
*.pdf file and 'cmd.exe' yes !
How can i solve ?
i'd like to solve it with a code that doesn't know the Acrobat Reader path


3.Open a pdf file in default pdf viewer from VB 6.0

I thought I was trying to do something really simple, but can't figure it out.

I want to be able to click on a command button and have a known pdf
file open up in a user's default pdf browser.  (Kind of like when you double
click a pdf file from windows explorer)

Is there an easy way to do this, or some code that will determine the location
of the default application (in this case pdf) executable file?

Shell only seems to work on executable files... I can run an application, but
don't know how to then open up a specific file within that application.

4.Open a .pdf file using vba in excel 2003

Hi everyone,
I have a sub that searches for files in a directory and adds them to the 
list box. I want the user to be able to click on a filename inside the 
listbox and open it (pdf file). Can someone give me some suggestions on how 
to do this? thanks for your help. here is what i got:

Dim fs As Object
Dim I As Integer
'Dim Flange_sname(100) As String
Set fs = Application.FileSearch
With fs
    .LookIn = "X:\Omar\Finished_Flanges"
    .SearchSubFolders = False
    .Filename = Flange_sname
    .FileType = ".pdf"
    If .Execute() > 0 Then
        'MsgBox "There were " & .FoundFiles.Count & " file(s) found."
        For I = 1 To .FoundFiles.Count
            'MsgBox .FoundFiles(I)
            Lbx_file_names.AddItem .FoundFiles(I)
        Next I
        'MsgBox "There were no files found."
    End If
End With

this returns = X:\Omar\Finished_Flanges\14_600_RTJ_WN_S40.pdf pdf file stored as OLE object using VBA

6. How do I open PDF file directly from a web site without the File Download window

7. word in open then opens pdf file but does not open to adobe read

8. How to merge existing PDf file in the same folder to one PDF file

Return to MS Office Access


Who is online

Users browsing this forum: No registered users and 75 guest