LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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
Else
'MsgBox "There were no files found."
End If
End With

this returns = X:\Omar\Finished_Flanges\14_600_RTJ_WN_S40.pdf
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I open a .pxl file in Excel 2003? mmcooper Excel Discussion (Misc queries) 0 July 20th 08 07:44 PM
Saved *.csv file gives SYLK file type warning upon Excel 2003 open Tom Excel Discussion (Misc queries) 5 March 19th 08 03:15 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
I have Excel 2003 and want to open an old WB2 file How do i do it JONB Excel Discussion (Misc queries) 0 December 23rd 05 09:35 AM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"