VB and VBA Users Source Code: Showing the "File Properties" dialog for a file
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Showing the "File Properties" dialog for a file
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Friday, June 18, 2004
Hits:
1654
Category:
Files/Directories/IO
Article:
The code below shows the windows file properties dialog for the specified file: Private Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As ShellExecuteInfo) As Long Private Type ShellExecuteInfo cbSize As Long fMask As Long hwnd As Long lpVerb As String lpFile As String lpParameters As String lpDirectory As String nShow As Long hInstApp As Long lpIDList As Long lpClass As String hkeyClass As Long dwHotKey As Long hIcon As Long hProcess As Long End Type 'Purpose : Shows the file properties dialog for the specifed file 'Inputs : sFileName The name of the file to show the properties of. ' [lHwdForm] The handle of the dialog showing the form 'Outputs : N/A 'Author : Andrew Baker 'Date : 08/01/2001 20:24 'Notes : 'Revisions : Sub ShowProperties(sFileName As String, Optional lHwdForm As Long) Dim SEI As ShellExecuteInfo Const SEE_MASK_INVOKEIDLIST = &HC, SEE_MASK_NOCLOSEPROCESS = &H40, SEE_MASK_FLAG_NO_UI = &H400 With SEI .cbSize = Len(SEI) .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI .hwnd = lHwdForm .lpVerb = "properties" .lpFile = sFileName .lpParameters = vbNullChar .lpDirectory = vbNullChar .nShow = 0 .hInstApp = 0 .lpIDList = 0 End With ShellExecuteEX SEI End Sub
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder