ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Document Properties in Word documents and Excel workbooks (https://www.excelbanter.com/excel-programming/448150-custom-document-properties-word-documents-excel-workbooks.html)

[email protected]

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.

Ron Rosenfeld[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
On Sat, 9 Feb 2013 03:13:04 -0800 (PST), wrote:

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.


There's a DLL mentioned on Chip Pearson's site, but it doesn't work for Excel 2007 or later. But see he
http://technet.microsoft.com/en-us/l.../ee176615.aspx for a method of doing this through the shell.

isabelle

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


GS[_2_]

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



Ron Rosenfeld[_2_]

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

GS[_2_]

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



isabelle

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


GS[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

...on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)

--
Garry

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



GS[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
I just installed the Office 2007 Compatibility Pack on my Win7 Pro x64
machine and it put msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

...NOT under Program Files (x86) as I assumed!

--
Garry

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



CellShocked

Custom Document Properties in Word documents and Excel workbooks
 
On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?

GS[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
CellShocked formulated the question :
On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?


I installed the Office 2007 Compatibility Pack and dsofile and all is
working fine on my Win7 Pro x64 machine!

--
Garry

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



isabelle

Custom Document Properties in Word documents and Excel workbooks
 
hi GS,

i think so, on my new pc, this file is located here

C: \ Program Files \ Common Files \ Microsoft Shared \ Office14

isabelle

Le 2013-02-10 04:03, GS a écrit :
Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


CellShocked

Custom Document Properties in Word documents and Excel workbooks
 
On Sun, 10 Feb 2013 08:46:25 -0500, GS wrote:

CellShocked formulated the question :
On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?


I installed the Office 2007 Compatibility Pack and dsofile and all is
working fine on my Win7 Pro x64 machine!



I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.

GS[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
CellShocked submitted this idea :
I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.


I would think that at the time the page was written Vista was the
latest OS since Dsofile.dll hasn't been updated since 2007!<g

--
Garry

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



GS[_2_]

Custom Document Properties in Word documents and Excel workbooks
 
isabelle explained on 10/02/2013 :
hi GS,

i think so, on my new pc, this file is located here

C: \ Program Files \ Common Files \ Microsoft Shared \ Office14

isabelle

Le 2013-02-10 04:03, GS a écrit :
Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


I'm of the opinion that installing to *Program Files* on an x64 machine
is probably forced (ie: hard coded) since most x86 stuff installs under
*Program Files (x86)*!

--
Garry

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



CellShocked

Custom Document Properties in Word documents and Excel workbooks
 
On Sun, 10 Feb 2013 11:19:12 -0500, GS wrote:

CellShocked submitted this idea :
I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.


I would think that at the time the page was written Vista was the
latest OS since Dsofile.dll hasn't been updated since 2007!<g



Ahhh... the old 'forgot to note da age of da page' thing...


All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com