Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Changing File "Summary" Properties Programmatically

Hey,

I am needing to write to the Summary properties of a file.
The properties are the ones in the Summary tab of a file (When you
right click on a file, then click on the properties tab, then click on
the Summary tab - you will see Title, Subject, Author, Category,
Keywords, Comments). These are the properties I am trying to WRITE.

I cannot use DSO, so DSO is not an option.

I have found that these properties are actually stored in a seperate
hidden file that is attached to the main file I am trying to change
the properties for. These are called NTFS Alternate Data Streams.
http://users.telenet.be/ws36637/properties.html

Problem is I cant figure out how to write to these files(i.e.
properties)
How would I be able to do this in VBA?

Thanks
Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Changing File "Summary" Properties Programmatically


You can use the "BuiltInDocumentProperties" property of the workbook.
From the help file...
ActiveWorkbook.BuiltinDocumentProperties.Item("Tit le") _
.Value = "Year-End Sales Results"
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html
(30 different ways to sort in excel)





"hutteto"
wrote in message
...
Hey,

I am needing to write to the Summary properties of a file.
The properties are the ones in the Summary tab of a file (When you
right click on a file, then click on the properties tab, then click on
the Summary tab - you will see Title, Subject, Author, Category,
Keywords, Comments). These are the properties I am trying to WRITE.

I cannot use DSO, so DSO is not an option.

I have found that these properties are actually stored in a seperate
hidden file that is attached to the main file I am trying to change
the properties for. These are called NTFS Alternate Data Streams.
http://users.telenet.be/ws36637/properties.html

Problem is I cant figure out how to write to these files(i.e.
properties)
How would I be able to do this in VBA?

Thanks
Todd



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Changing File "Summary" Properties Programmatically

Jim, the files that i will be setting properties for will be .OFT
files and they will be closed.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Changing File "Summary" Properties Programmatically

hutteto explained :
Jim, the files that i will be setting properties for will be .OFT
files and they will be closed.


There's a couple of things you should know about NTFS
SummaryProperties.

1. They only exist if the volume they are stored on is formatted NTFS.
Otherwise, moving/copying them to a non-NTFS volume scrubs these.

2. Although Vista/Win7 are NTFS, they don't support these properties
any longer.

3. Jim's suggestion is good for app files of compound structure. What
is an '.OFT' file anyway? Is it a compound structure?

4. DSOfile.dll is the only MS supported lib that allows direct
read/write of NTFS SummaryProperties without opening files. Desaware
makes a lib that does similar to DSOfile, but this won't read/write
'Category' as a SummaryProperty because it's considered a
DocumentSummaryProperty. DSOfile reads/writes all regardless of their
classification.

5. There's no VB/VBA class source code available that reads/writes the
NTFS Alternate Data Streams. It requires advanced use of several
complex interfaces and so everyone opts for the easier DSO lib as a
solution.

History:
I have used these SummaryProperties with CNC program files, which are
plain text files, so people working from a PC could see what the files
were. Typically, they have filenames like "O0001, O0010, O0011", which
are pretty non-descript. Using NTFS SummaryProperties allows people to
read descriptive info about the file via Windows Explorer's optional
columns.

Because CNC prog files are typically downloaded to machining centers
having non-NTFS drives, these same props are imbedded inside the file
and my CNC file manager app is used to read/write these along with the
SummaryProperties IF the filepath is a NTFS volume.

Thus, why I know the ins & outs of using these props on non-structured
files.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Changing File "Summary" Properties Programmatically

Garry,

..oft files are MS outlook email template files. We are running
Windows XP here with Office 2007. The file format I am running the
code from is .xlsm. I was having problems when I tried to use
DSOFile.dll, eventhough I regestered the file and set a reference to
it in my project. It was giving me the runtime error like it didnt
know what the dsofile objects were like I didnt have a reference set
for it. From what I read DSOfile is not supported in the .xlsm
format, so this is why I was getting errors. There has got to be a
way to do this using the the NTFS data streams... The file system is
NTFS.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Changing File "Summary" Properties Programmatically

hutteto explained on 1/3/2011 :
Garry,

.oft files are MS outlook email template files. We are running
Windows XP here with Office 2007. The file format I am running the
code from is .xlsm. I was having problems when I tried to use
DSOFile.dll, eventhough I regestered the file and set a reference to
it in my project. It was giving me the runtime error like it didnt
know what the dsofile objects were like I didnt have a reference set
for it. From what I read DSOfile is not supported in the .xlsm
format, so this is why I was getting errors. There has got to be a
way to do this using the the NTFS data streams... The file system is
NTFS.


DSOfile.dll does work in Excel 2007/2010 with VBA. I'm not sure how
you're using it that it's giving you an error. It must be installed and
registered on each machine that uses your xlsm. Is this the case?

Otherwise, my Excel addin version of the cnc program files manager
works just fine writing to SummaryProperties. Are you saying it doesn't
work for you on any machine? Show me your code and I'll see if I can
spot why!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel cells changing to "#VALUE!" whenever another file is opened kk Excel Discussion (Misc queries) 8 March 12th 10 01:58 PM
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM
Changing "returned" values from "0" to "blank" LATATC Excel Worksheet Functions 2 October 20th 05 04:41 PM


All times are GMT +1. The time now is 07:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"