Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing File Properties 1

Status
Not open for further replies.

JohnBrooks

Programmer
Jul 24, 2001
4
GB
I need to be able to access the properties of any file. I'm not talking about the attributes such as date created, length of file etc. (which have been covered in another thread) but items such as author, comments etc which are used in most Office applications and lots of of non Microsoft apps.. This information is displayed in Windows Explorer when the file name is right clicked but I cannot find any reference as to how to read and write these properties using VB. (I know how to do it for a specific application e.g. Word but I want a general solution that works with other applications. Any suggestions would be appreciated.
 
What might help get you started in the SHGetFileInfo API.
The dwAttributes field contains lots of flag. This is the basic definition.

Type SHFILEINFO ' shfi
hIcon As Long
iIcon As Long
dwAttributes As Long
szDisplayName As String * 260
szTypeName As String * 80
End Type

Declare Function SHGetFileInfo Lib "Shell32" Alias "SHGetFileInfoA" _
(ByVal pszPath As Any, _
ByVal dwFileAttributes As Long, _
psfi As SHFILEINFO, _
ByVal cbFileInfo As Long, _
ByVal uFlags As Long) As Long

I have more info, and some sample code on my other machine and can post it tomorrow if you're interested. But at least this may get you started. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top