Solved

Summary info (Author, Subject, Company, Keywords, Category, ...) in Windows 2000 server and later. For ALL Type of files.

Posted on 2004-10-11
8
372 Views
Last Modified: 2010-04-12
Hi all,

I know DSOleFile is on the net and i use it for most of the files. But when I try to get the summary info for a pdf or even a xml file it gives me an error.!

Any idea or coding I could use to get the summary info of pdf files and xml files. Actually I'd like to have that for any type of file.

So if you can give me the right coding in C# or VB.net or something like that for summary info of .doc .xls .pdf .xml .vsd .jpg .tif .msg you get the points.

This is what I had. It works for most of the documents but not all :)

    Sub GetCProps()
        Dim oFilePropReader As DSOleFile.PropertyReader
        Dim oDocProp As DSOleFile.DocumentProperties

        Path = "c:\test\doc.pdf"

        Try
            oFilePropReader = New DSOleFile.PropertyReader
            oDocProp = oFilePropReader.GetDocumentProperties(path)
            MessageBox.Show("Author: " & oDocProp.Author & vbCrLf & "Title: " & oDocProp.Title & vbCrLf & "Subject: " & oDocProp.Subject)
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try

    End Sub

Good luck  :p
0
Comment
Question by:Alexdelen
  • 4
  • 4
8 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 12278385
DSOleFile is really intended for getting properties of MSOffice files, although Microsoft says it'll work for any OLE compound document when used on Windows 2000, and presumably later, with an NTFS file system.  Here's a link to a Microsoft Knowledgebase article that details that: http://support.microsoft.com/?kbid=224351.  There's another approach though that seems to work for any document.  Here's a link to a page that describes it:  http://www.microsoft.com/technet/community/scriptcenter/filefolder/scrff64.mspx  The code here is VBScript which should be simple enough to convert to straight VB.  I've tested this code with a variety of files including jpg, gif, html, etc. and it works for all of them.  I don't have a single pdf file that has any properties so I haven't been able to test it against this type of file.
0
 
LVL 1

Author Comment

by:Alexdelen
ID: 12284462
this link doesn't seem to work for me:  http://www.microsoft.com/technet/community/scriptcenter/filefolder/scrff64.mspx

Can you put the code over here?

Thanks

0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 12286241
Hmmm, the link doesn't work for me today either.  In fact every link to specific scripts seems to take me to the ScriptCenter home page.  Seems as if something's changed on that site.  Anyway, here's the code.  Change the folder path on the third line to your folder path.

Dim arrHeaders(34)
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Testing")
For i = 0 to 33
    arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
For Each strFileName in objFolder.Items
    For i = 0 to 33
        Wscript.echo i & vbtab & arrHeaders(i) _
            & ": " & objFolder.GetDetailsOf(strFileName, i)
    Next
Next
0
 
LVL 1

Author Comment

by:Alexdelen
ID: 12287104
Found it in the meanwhile.

Great job on this. One more additional question do you know any code to modify those props?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 76

Expert Comment

by:David Lee
ID: 12293263
Modify them how?  
0
 
LVL 1

Author Comment

by:Alexdelen
ID: 12295250
Now i can read them with this script but is it also possible to modify them (the value) with wscript vbs or anything else?

0
 
LVL 76

Expert Comment

by:David Lee
ID: 12296439
No, sorry, I don't know of any way to do that.
0
 
LVL 1

Author Comment

by:Alexdelen
ID: 12296994
anyway you helped me on this one and it was very useful

accepted
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now