PDA

View Full Version : Extended Properties for Word 2011 documents



Pathagoras
09-07-2011, 10:19 AM
Office for Windows allows one to read a document's extended properties without having to open the file. (A Windows tool called DSOFile.dll exists to make that process even easier).

I am making the transition to Mac and Office 2011, but DSOFile does not work on a Mac and I really need a replacement for it. Does anyone know of a way to read a Word document's (or other Office file's) extended properties without opening the file.

mikerickson
09-08-2011, 06:30 PM
What are extended properties? It sounds like a Window's thing.
But you might want to look into AppleScript. Office2011 VBA file handling is not well suited to Macs, but the MacScript command allows VBA to use AppleScript in VBA, which is well suited to Mac files.

Pathagoras
09-08-2011, 07:11 PM
What are extended properties? It sounds like a Window's thing.

The 'subject' and 'author' and 'comments' and similar 'meta data' associated with each .doc and .docx file are the 'extended properties.' They can be 'read' (at least in a Windows environment) without fully opening the document. Looking for the way to do so in Mac VBA (Office 2011).

mikerickson
09-08-2011, 10:48 PM
For a closed file, something like this perhaps.

Dim filePath As String
Dim strScript As String

filePath = Application.GetOpenFilename
If filePath = "False" Then Exit Sub: Rem canceled

strScript = "tell application ""Finder"" "
strScript = strScript & vbCr & "properties of file " & Chr(34) & filePath & Chr(34)
strScript = strScript & vbCr & "end tell"

Range("A1").Value = MacScript(strScript)


AppleScript guide (http://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html)