473,395 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

filter by file properties

I'm trying to build a filter for a file search where the search will be able
to filter out certain files according to certain "file properties", like
Owner, Creation Date, etc.
MS does this in some Open dialogs, within the dialog, you can click on
Tools->Search->Advanced and search for files with specified file properties.

Any ideas on how this is done in C#?
Nov 16 '05 #1
4 5359
Hi
You can use the FileVersonInfo class of the diagnostic namespace

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticsfileversioninfoclasstopic.as p

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
Yes, but that doesn't show the custom "properties" that can be added when
you: right click on file (for example MS Word file), click properties, go to
the "Custom" or "Summary" tabs and enter data. Where is this data stored?
And is there an API to access this data?

Thanks.

"Mohamoss" wrote:
Hi
You can use the FileVersonInfo class of the diagnostic namespace

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticsfileversioninfoclasstopic.as p

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3
Appearantly there is no managed way to do this in C#, I got this from MS:

http://msdn.microsoft.com/library/de...sofficedev.asp

Excerpt:
How do I access my document properties in an Office document?

You can automate Microsoft Word, Excel or PowerPoint with Visual C++ to
retrieve and manipulate both built-in and custom document properties. For
more information and an example, see HOWTO: Use Visual C++ to Access
DocumentProperties with Automation (Q238393).

You can also retrieve document property information without Automation and
even without the need for the Office application that created the file.
Office documents are OLE compound documents that store document properties in
persistent property sets. These property sets are managed by COM/OLE and can
be retrieved using the IPropertySetStorage and IPropertyStorage interfaces.
For details, see HOWTO: Read Compound Document Properties Directly with VC++
(Q186898) and Dsofile.exe Lets You Edit Office Document Properties from
Visual Basic and Active Server Pages (Q224351).
"Craig" wrote:
Yes, but that doesn't show the custom "properties" that can be added when
you: right click on file (for example MS Word file), click properties, go to
the "Custom" or "Summary" tabs and enter data. Where is this data stored?
And is there an API to access this data?

Thanks.

"Mohamoss" wrote:
Hi
You can use the FileVersonInfo class of the diagnostic namespace

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticsfileversioninfoclasstopic.as p

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #4
Ok, here's the answer, in case someone is interested:

If you don't want to use automation (automation requires ms office product
be installed),
Do a search for dsofile.dll, ms supplies an executable that will create the
dll and a sample in a directory for you.
http://support.microsoft.com/?kbid=224351

This is a MS library for reading document properties, and using it is
extremely simple:
Add library as reference

DSOleFile.PropertyReader propReader =
new DSOleFile.PropertyReaderClass();
DSOleFile.DocumentProperties docProps=
propReader.GetDocumentProperties("C:\test.doc");

and that's it.


"Craig" wrote:
Appearantly there is no managed way to do this in C#, I got this from MS:

http://msdn.microsoft.com/library/de...sofficedev.asp

Excerpt:
How do I access my document properties in an Office document?

You can automate Microsoft Word, Excel or PowerPoint with Visual C++ to
retrieve and manipulate both built-in and custom document properties. For
more information and an example, see HOWTO: Use Visual C++ to Access
DocumentProperties with Automation (Q238393).

You can also retrieve document property information without Automation and
even without the need for the Office application that created the file.
Office documents are OLE compound documents that store document properties in
persistent property sets. These property sets are managed by COM/OLE and can
be retrieved using the IPropertySetStorage and IPropertyStorage interfaces.
For details, see HOWTO: Read Compound Document Properties Directly with VC++
(Q186898) and Dsofile.exe Lets You Edit Office Document Properties from
Visual Basic and Active Server Pages (Q224351).
"Craig" wrote:
Yes, but that doesn't show the custom "properties" that can be added when
you: right click on file (for example MS Word file), click properties, go to
the "Custom" or "Summary" tabs and enter data. Where is this data stored?
And is there an API to access this data?

Thanks.

"Mohamoss" wrote:
Hi
You can use the FileVersonInfo class of the diagnostic namespace

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticsfileversioninfoclasstopic.as p

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jj23 | last post by:
Hi all, I am really new to XML and have been asked to do a simple task o filtering out records from an XML source. The source XML however, i hard to understand and I can't quite figure out how...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
16
by: Nhmiller | last post by:
I already have a report designed under Reports. When I use filtering in Forms or Tables, I see no way to select that filtered list when I am in Reports, and there appears to be no way to do the...
2
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL...
1
by: Jay | last post by:
I need to add a parameter to a directorysearcher.filter rather than using hard-coded text. I have the following code that finds all members of an AD group and then for each of those results tries...
1
by: Stanley | last post by:
Hello all, I have a custom collection that I am using to fill a DropDown list that I need to filter out items based on another dropdown list. My problem is the actual filter in the collection. I...
2
by: Jeff Calico | last post by:
Hello everyone I have sucessfully implemented a SAX filter to take a large XML data file, and strip it down to its essential elements, and then pass that on to an XSL transformer. (A bare bones...
6
by: Chris Zoper | last post by:
Hello, I have a form that shows a lot of records based on a passthrough query to a SQL Server database. I noticed that the Filter and the Sort property of the form do not properly work, often...
2
by: Matthew Wells | last post by:
Hi there. I am a programmer for a living, but this problem has my whole team stumped. I have a subform based on a query. I'm not using the "LinkMaster/ChildFields" properties ( I have my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.