I am developping an user interface in VBA to manage an MS access database. I am confronted with a task that consists to open any document file store on a computer using a VBA command. I can do that that for any MS office document but failing with other document file like pdf, or image. Can anyone have some tips?
Thanks in advance
Below is the sub that is working with word document.
Private Sub OpenFile_DblClick(FileName as string) Dim fExt As String fExt = LCase(Mid(fName, InStrRev(fName, ".") + 1)) 'To extrat the file extension Select Case fExt Case "doc" Dim obj As Word.Application Set obj = CreateObject("word.application") obj.Documents.Open FileName obj.Visible = True obj.WindowState = wdWindowStateNormal obj.Activate Case "pdf" ......here is the problem............. Case Else End Select End Sub
Edited 6 Years Ago by Nick Evan: Added CODE-tags