Public 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 Optional parameter
lpClass As String Optional parameter
hkeyClass As Long Optional parameter
dwHotKey As Long Optional parameter
hIcon As Long Optional parameter
hProcess As Long Optional parameter
End Type
Public Const SEE_MASK_INVOKEIDLIST = &HC
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SEE_MASK_FLAG_NO_UI = &H400
Public Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Public Sub ShowFileProperties(strFilename As String)
open a file properties property page for
specified file if return value
Dim SEI As SHELLEXECUTEINFO
Fill in the SHELLEXECUTEINFO structure
With SEI
.cbSize = Len(SEI)
.fMask = SEE_MASK_NOCLOSEPROCESS Or _
SEE_MASK_INVOKEIDLIST Or _
SEE_MASK_FLAG_NO_UI
.hWnd = 0
.lpVerb = "properties"
.lpFile = strFilename
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = 0
End With
call the API to display the property sheet
Call ShellExecuteEx(SEI)
End Sub