Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim, the files that i will be setting properties for will be .OFT
files and they will be closed. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel cells changing to "#VALUE!" whenever another file is opened | Excel Discussion (Misc queries) | |||
How do I stop "global" hyperlinks changing to "local" links? | Excel Worksheet Functions | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions |