Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Custom Document Properties in Word documents and Excel workbooks

Does anyone know how to read the Custom Document properties of a Word document or Excel workbook from VBA without opening the workbook or Word document?

This can be done interactively manually by right-clicking on the file name and selecting Properties | Custom on the dialog box that appears. This does not involve opening the file.

However, does anyone know if there is a way of accomplishing the above without opening the file?

I need to a hierarchical directory tree-walk on a folder that contains many thousands of Excel workbooks and Word documents, looking for specific Custom Document properties. I can do so, if I open and close the files, but this is very long-winded and might not be necessary.

I should say that I use Custom Document properties extensively in Excel.

Any insights would be appreciated. Thank you.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Custom Document Properties in Word documents and Excel workbooks

hi,

this macro works on xl2010

Sub Macro1()
Dim arrHeaders(35)
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Users\Public\Documents")
For i = 0 To 34
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
For Each strFileName In objFolder.Items
For i = 0 To 34
Debug.Print arrHeaders(i) _
& ": " & objFolder.GetDetailsOf(strFileName, i)
Next
Next
End Sub

isabelle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!

This task requires the OLE File Property component named "dsofile.dll".
To work with Office12 and later will also require the Office 2007
Compatibility Pack.

I'm not sure, but I think you may also be able to do this via ADODB.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Custom Document Properties in Word documents and Excel workbooks

On Sat, 09 Feb 2013 13:59:55 -0500, GS wrote:

I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!


Good Point


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

GS wrote on 09/02/2013 :
I think the key words in the OP's Q are "Custom Document Properties". Note
that the suggested approach only works with "Extended File Properties"!

This task requires the OLE File Property component named "dsofile.dll". To
work with Office12 and later will also require the Office 2007 Compatibility
Pack.

I'm not sure, but I think you may also be able to do this via ADODB.


You can download dsofile here...

http://support.microsoft.com/kb/224351

...which includes samples and source code.

You can get the Office Compatibility Pack here...

http://www.microsoft.com/en-us/downl...ails.aspx?id=3

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Custom Document Properties in Word documents and Excel workbooks

thanks GS for this point, also, more informations here for the systems
64 bits

http://dotnet.dzone.com/articles/tip...ile-x64-os-and

isabelle

Le 2013-02-09 16:37, GS a écrit :
GS wrote on 09/02/2013 :
I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!

This task requires the OLE File Property component named
"dsofile.dll". To work with Office12 and later will also require the
Office 2007 Compatibility Pack.

I'm not sure, but I think you may also be able to do this via ADODB.


You can download dsofile here...

http://support.microsoft.com/kb/224351

..which includes samples and source code.

You can get the Office Compatibility Pack here...

http://www.microsoft.com/en-us/downl...ails.aspx?id=3

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Word documents into Excel document Vicatra Excel Discussion (Misc queries) 1 March 26th 09 10:15 PM
Retrieving custom document properties - Excel 2007 Barb Reinhardt Excel Programming 3 August 7th 08 04:33 PM
How can I using Excel custom document properties in the header? ecalvo Excel Worksheet Functions 4 November 3rd 05 09:29 PM
How can I set Custom DOC Properties in Word from Excel Stu78[_2_] Excel Programming 0 August 4th 05 03:20 PM
Accessing custom document properties in Word? quartz[_2_] Excel Programming 1 January 19th 05 02:27 AM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"