When I right click on a file and choose 'Properties' I have a tab called 'Summary', in which there are several things such as 'Title', 'Subject', 'Comments', and some other stuff.
I'm wondering if there is a way to access and write to these properties, and if so, how. I have tried with FSO but couldn't figure it out Any help would be greatly appreciated.
JO
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
All you need to do is open the file's property sheet, programmatically. This will give you the same thing as right mouse clicking on a file from Windows Explorer.
VB Code:
Option Explicit
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
Private Const SEE_MASK_INVOKEIDLIST = &HC
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
Private Const SEE_MASK_FLAG_NO_UI = &H400
Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Private Sub ShowProperties(FileName As String, OwnerhWnd As Long)
if so here is a program that can read and write to those properties, it is not written by me, but i have used some of the code.
it appears to work on a NTFS files system, but i have not tried it it on a FAT file system and i believe there maybe be differences, as discussed in a thread a few days ago.
Remember it writes to your mp3 files and until it is well tested should only be used on backups
When I right click on a file and choose 'Properties' I have a tab called 'Summary', in which there are several things such as 'Title', 'Subject', 'Comments', and some other stuff.
I'm wondering if there is a way to access and write to these properties, and if so, how.
No you can't alter these properties, they are set when the exe is compiled. You can read them quite easily.
Anyway why do you want to alter them? If you made the exe then its easy.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
well you can certainly change them in explorer, so chnging them by program would have to be possible too
i don't think he is meaning exes, more likley docs or mp3s
pete
You can't change the properties of any file in Explorer well you can't with Win98.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
You can't change the properties of any file in Explorer well you can't with Win98.
That is true of most commerical software (such as the MS Office suite). Most VB .Exes, however, do permit this (I just compiled a Project1.Exe and I could update anything I wanted on the summary tab.)
My assumption, of the original request however, was that he wanted to be able to update the Summary tab of documents and spreadsheets, and stuff like that.