Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting Word documents into Excel document | Excel Discussion (Misc queries) | |||
Retrieving custom document properties - Excel 2007 | Excel Programming | |||
How can I using Excel custom document properties in the header? | Excel Worksheet Functions | |||
How can I set Custom DOC Properties in Word from Excel | Excel Programming | |||
Accessing custom document properties in Word? | Excel Programming |