Find target button

abubasil

Registered User.
Local time
Today, 22:12
Joined
Aug 31, 2011
Messages
29
Hi dear all
I am not a programer ! in fact I am too late for this being 41 yrs old :D
yet I could make three (programs) ..simple ones
the latest is (Electronic archive) for our company scanned docs
I made a table with these fields Doc_Id ,Doc_subject..Doc_dt date of documentation"=date()" and Doc_Dept > the department to it its belongs.. the last field is the path of the document itself in the Pc
I could fined pretty vba code to open common dialog (select file) and got the path of the pic into its field in the table and saveD it as data of text type..and I made picture1.picture to make use of the path to show preview ..
now what do I need is a button just like that in windows when you right click a shortcut and hit the find target button and locate the origin file
I have tried to make a macro to run explorer.exe but no option to pass the path of the pic as a parameter to it ..and so I needed vba code to do that
help please
 
Hi..

you can use it..
Be sure to include the necessary reference..:

VBa editor / Tools / References / Microsoft Office xx.x Object Library

Code:
Dim dlg As FileDialog
Dim si As Variant
Dim FileName As String
Dim vrtSelectedItem As Variant
Set trz = Application.FileDialog(msoFileDialogFilePicker)
With trz
    .AllowMultiSelect = False
    .Filters.Add "all", "*.*"
    .FilterIndex = 0
    .InitialFileName = Environ("UserProfile") & "\My Documents\"
    .InitialView = msoFileDialogViewThumbnail
    .Title = "select..."
        If .Show = True Then
            For Each vrtSelectedItem In .SelectedItems
            FileName = vrtSelectedItem
            Next vrtSelectedItem
MsgBox FileName
        End If
End With
 
Back ....Tahnk you Dear friend
I couldnt make use of this code ..I didnt understant how to use it .. and basicly I think it is not the one I need for I already have a code to select the pics and gt its path to my form ..
want I wanted si to located the file of the pic by using its path..read my post again i was clear ..and thanks anyway and sorry to be late .. it was Eid alfir days
good luck
 

Users who are viewing this thread

Back
Top Bottom