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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting contenttypeproperty of multiple document types

Status
Not open for further replies.

kreplech

IS-IT--Management
Nov 16, 2007
18
US
hello all,

i'm new to all of this, so please forgive me if i'm not making sense...

i'm writing an excel 2007 vba macro that should traverse a directory and get the contenttypeproperties of each file.

the directory will contain many different document types - doc, xls, pdf to name a few.

the trouble is, as i see it, that i need to open the file to get the contenttypeproperty. so, i would need to anticipate the document type and write a subroutine for each.

is there a way to get contenttypeproperties for each file in folder regardless of document type?

thanks!
 


Hi,

The Document.ContentTypeProperties Property is an MS Word Document property.

Don't you want to look at the file extension to make the "doc, xls, pdf" etc?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


oops, I see that it is a property of several MS Office documents in 2007.

But, yes, it is burried in the doc and you must open to access

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
well, the directory i'm working with is actually a SharePoint document library. using SP you can define custom properties. you can use contenttypeproperties to read those custom properties from the files.

the problem is, i don't know of a way to read the properties without first knowing the document type.

i can use file.type or something to get the document type, but then i still have to write seperate code per type - and have anticipated and written a piece of code for each type just in case it exists in the directory.

i'm hoping there's a way around this.
 
DSOFile may be a partial solution.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top