Nur für 32Bit Office Versionen
Problemstellung:
Wie kann ich den Dateieigenschaften-Dialog anzeigen lassen?
Lösung:
Folgenden Code in ein neues Modul kopieren.
Public Declare Function GetDesktopWindow _ Lib "user32" () As Long Public Declare Function ShellExecuteEX _ Lib "shell32.dll" Alias "ShellExecuteEx" ( _ lpShellExInfo As tShellExInfo) As Long Public Type tShellExInfo 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 Public Const SEE_MASK_INVOKEIDLIST = &HC Public Const SEE_MASK_NOCLOSEPROCESS = &H40 Public Const SEE_MASK_FLAG_NO_UI = &H400 Public Function ShowShellObjectInfo( _ ByVal sObjName As String, _ Optional ByVal lngHWnd As Long = 0) As Long Dim typShellExInfo As tShellExInfo Dim lngRet As Long With typShellExInfo .cbSize = Len(typShellExInfo) .fMask = SEE_MASK_NOCLOSEPROCESS Or _ SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI .hwnd = IIf(lngHWnd = 0, GetDesktopWindow, lngHWnd) .lpVerb = "properties" .lpFile = sObjName .lpParameters = vbNullChar .lpDirectory = vbNullChar .nShow = 0 .hInstApp = 0 .lpIDList = 0 End With lngRet = ShellExecuteEX(typShellExInfo) If Not (typShellExInfo.hInstApp > 32) Then ShowShellObjectInfo = -1 Exit Function End If ShowShellObjectInfo = 0 End Function
Aufruf z.B.:
ShowShellObjectInfo "D:\users\Daten\Vorlagen\Handkassenbeleg.doc"
Ergebnis:
Ähnliche Artikel
Weiterlesen...